Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-29-2008, 03:13 PM
Member
 
Join Date: May 2008
Posts: 12
palanikumark is on a distinguished road
Send a message via Skype™ to palanikumark
How to store extracted xml values in a database?
Hi friends,
I created this program using JSTL which extract details from xml... Now i want to store that extracted values in a database.. How can i store that extracted values in a database..? Here is my code...
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-29-2008, 10:24 PM
Member
 
Join Date: May 2008
Posts: 21
gogoc is on a distinguished road
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
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-30-2008, 08:46 AM
Member
 
Join Date: May 2008
Posts: 12
palanikumark is on a distinguished road
Send a message via Skype™ to palanikumark
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....
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 05-30-2008, 08:51 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
You mean, you don't know how to store values in a DB or your code doesn't work?
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 05-30-2008, 09:25 AM
Member
 
Join Date: May 2008
Posts: 12
palanikumark is on a distinguished road
Send a message via Skype™ to palanikumark
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?
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 05-30-2008, 09:33 AM
Eranga's Avatar
Moderator
 
Join Date: Jul 2007
Location: Colombo, Sri Lanka
Posts: 3,486
Eranga has a spectacular aura aboutEranga has a spectacular aura about
Send a message via Yahoo to Eranga
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.
__________________
Use an appropriate Subject. "Help, urgent!" isn't one.
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Has someone helped you? Then you can
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
their helpful post.

Want to make your IDE the best?
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #7 (permalink)  
Old 05-30-2008, 01:14 PM
Member
 
Join Date: May 2008
Posts: 12
palanikumark is on a distinguished road
Send a message via Skype™ to palanikumark
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="jdbcdbc:db1" var="db1" />


<c:import var="students" url="students.xml" />

<xarse 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>
<cut value="record added"/>
<c:forEach var="row" items="${query1.rowsByIndex}" >
<tr>
<td> <cut value="${row.first}" /></td>
<td> <cut value="${row.last}" /></td>
<td> <cut value="${row.middle}" /></td>
</tr>
</c:forEach>

Last edited by palanikumark : 05-30-2008 at 01:17 PM.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Retaining DB values as well as Dynamically generated Values.. Help Needed ! rajivjha Advanced Java 0 05-22-2008 11:53 AM
getting values from database in dropdown aa74 JavaServer Pages (JSP) and JSTL 1 04-21-2008 11:00 PM
how to populate html:select with values from database sathya_k_83 JavaServer Pages (JSP) and JSTL 1 11-07-2007 11:53 AM
How can I store an image to the database using hibernate cryss_tyna Database 0 08-15-2007 02:48 PM


All times are GMT +3. The time now is 04:00 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org