Results 1 to 7 of 7
- 05-29-2008, 02:13 PM #1
Member
- Join Date
- May 2008
- Posts
- 12
- Rep Power
- 0
- 05-29-2008, 09:24 PM #2
Member
- Join Date
- May 2008
- Posts
- 21
- Rep Power
- 0
you first need to create a db and depending upon the db load the driver and then do the proceedings...
get new coding problems at CODERWORDS
- 05-30-2008, 07:46 AM #3
Member
- Join Date
- May 2008
- Posts
- 12
- Rep Power
- 0
I created database and i cant able to store my values.... So that only i'm asking.... Here i cant able to show my codings....
- 05-30-2008, 07:51 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
You mean, you don't know how to store values in a DB or your code doesn't work?
- 05-30-2008, 08:25 AM #5
Member
- Join Date
- May 2008
- Posts
- 12
- Rep Power
- 0
How to store extracted xml values in a database?
Ya i dont know how to store my extracted values in a database... My program extracting details from XML file and displaying that extracted details... Now i want to knw how to store that values in a database using JSTL?
- 05-30-2008, 08:33 AM #6
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
So do a simple DB example first. Then try to implement it in your application.
On the Google you can found lots of such examples. Find one of it and try it. I don't have a sample.
- 05-30-2008, 12:14 PM #7
Member
- Join Date
- May 2008
- Posts
- 12
- Rep Power
- 0
Is my code is correct for inserting database... This code does not work and insert data into database...
<?xml version="1.0" encoding="ISO-8859-1"?>
<students>
<student id="1">
<name>
<first>Joe</first>
<last>Y</last>
<middle>T</middle>
</name>
<grade>
<points>99</points>
<letter>A</letter>
</grade>
</student>
<student id="2">
<name>
<first>James</first>
<last>Todd</last>
<middle>K</middle>
</name>
<grade>
<points>92</points>
<letter>B</letter>
</grade>
</student>
<student id="3">
<name>
<first>Kate</first>
<last>Wang</last>
<middle>A</middle>
</name>
<grade>
<points>72</points>
<letter>C</letter>
</grade>
</student>
</students>
JSTL coding
<sql:setDataSource driver="sun.jdbc.odbc.JdbcOdbcDriver" url="jdbc:odbc:db1" var="db1" />
<c:import var="students" url="students.xml" />
<x:parse var="doc" xml="${students}" />
<x:set var="a" select="$doc/students/student/name/first" />
<x:set var="b"
select="$doc/students/student/name/last" />
<x:set var="c"
select="$doc/students/student/name/middle" />
<sql:update var="query1" dataSource="${db1}" sql="insert into studentDetails values('${a}','${b}')">
</sql:update>
<c:out value="record added"/>
<c:forEach var="row" items="${query1.rowsByIndex}" >
<tr>
<td> <c:out value="${row.first}" /></td>
<td> <c:out value="${row.last}" /></td>
<td> <c:out value="${row.middle}" /></td>
</tr>
</c:forEach>Last edited by palanikumark; 05-30-2008 at 12:17 PM.
Similar Threads
-
Retaining DB values as well as Dynamically generated Values.. Help Needed !
By rajivjha in forum Advanced JavaReplies: 0Last Post: 05-22-2008, 10:53 AM -
getting values from database in dropdown
By aa74 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 04-21-2008, 10:00 PM -
how to populate html:select with values from database
By sathya_k_83 in forum JavaServer Pages (JSP) and JSTLReplies: 1Last Post: 11-07-2007, 10:53 AM -
How can I store an image to the database using hibernate
By cryss_tyna in forum JDBCReplies: 0Last Post: 08-15-2007, 01:48 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks