Forums Register Login

put Data from Vector into DB.

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
Vector or Object[][] ( is as well possible)
+Pie Number of slices to send: Send
You can use Batch Inserts.
+Pie Number of slices to send: Send
// 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();
My pie came with a little toothpic holding up this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1163 times.
Similar Threads
display data page vise
Booking method
writing to file from Vector
Vector within vector
Jtable boolean checkboxes
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:11:53.