wood burning stoves 2.0*
The moose likes JDBC and the fly likes put Data from Vector into DB. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "put Data from Vector into DB." Watch "put Data from Vector into DB." New topic
Author

put Data from Vector into DB.

tom1978
Greenhorn

Joined: Sep 08, 2002
Posts: 7
Hi,
for my current application i want to add Data to a Database. This data is stored in a Vector. Does anyone have an idea, how to do with (eg. loop).
I would be very happy about a code sample.
Greetings tom
tom1978
Greenhorn

Joined: Sep 08, 2002
Posts: 7
Vector or Object[][] ( is as well possible)
Chandresh Patel
Greenhorn

Joined: Jul 05, 2002
Posts: 14
You can use Batch Inserts.


Chandresh
Bill White
Ranch Hand

Joined: Oct 27, 2002
Posts: 82
// Create Connection and Statement object
Iterator iter = myVector.iterator();
while(iter.hasNext())
{
myObject = (MyObject)iter.next();
String sql = "whatever type of sql you need";
statement.addBatch(sql);
}
statement.executeBatch();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: put Data from Vector into DB.
 
Similar Threads
writing to file from Vector
Vector within vector
display data page vise
Booking method
Jtable boolean checkboxes