File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes inserting queries Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "inserting queries" Watch "inserting queries" New topic
Author

inserting queries

duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64


when i tried to execute this code, it is giving me only one value throughout. but i want all the values given in the xml file... please tell me where am i wrong in this code and how to get different desired values.
thanks a lot...
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

You only have one object, and you keep adding it to the List. Create a new object each time when you get data from the XML instead of reusing the single object.
duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
thank you so much but can you tell me in which line?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

You don't have an extremely large number of lines where you add an object to a list...
duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
i got that line by the way.... but thanks for your help. it was really very helpfull
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16487
    
    2

That's a very common "gotcha", by the way, a lot of beginners get caught doing that.
duhit Choudhary
Ranch Hand

Joined: Apr 01, 2012
Posts: 64
i'll try not to repeat these type of silly mistakes again...
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: inserting queries
 
Similar Threads
Passing a Querystring from one page to the next
Display Results into Table
Insert query from java program
java Date problem
Transactions