Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Derby Bulk Insert

 
pradeep selvaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have tried to create a table and bulk insert the table from a text file using derby. Here is my code,



The import text file has these contents....



i get this exception...when i run this constructor...
java.sql.SQLException: Table 'derbyDB' does not exist.
java.sql.SQLException: Table 'derbyDB' does not exist.


What am i doing wrong? please help

Thanks
pradeep
[ April 16, 2007: Message edited by: pradeep selvaraj ]
 
Gaurav Chikara
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot insert into a table unless that DDL statement is committed.Your code is trying to insert into a table without committting the create script of the table.
 
pradeep selvaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gaurav,

I tried with having conn.commit(); just after creating the table and after the first insert statement too, but when the bulk insert call executes i get this error
" Table 'derbyDB' does not exist. "

Wont conn.commit() solve the problem?

thanks
Pradeep
 
pradeep selvaraj
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found it!!!

Closing the connection and opening it again solves the problem.

Pradeep
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!