Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes 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: 412
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic