wood burning stoves 2.0*
The moose likes JDBC and the fly likes inserting queries Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
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: 18570
    
    8

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: 18570
    
    8

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: 18570
    
    8

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://aspose.com/file-tools
 
subject: inserting queries