File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

put Data from Vector into DB.

 
tom1978
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vector or Object[][] ( is as well possible)
 
Chandresh Patel
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use Batch Inserts.
 
Bill White
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
// 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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic