Subject | RE: [ib-support] firebird insertion error |
---|---|
Author | German Terrazas Angulo |
Post date | 2003-04-09T18:45:34Z |
Hi all,
I am sending the piece of java code which produce the error using Firebird...
---8<---8<---8<---8<---8<---8<
void jButton1_actionPerformed(ActionEvent e) {
try{
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:C:/home/diegoY/DOCTEC/Importerv1.0.4.1/DBDOCTEC.GDB",
"sysdba", "masterkey");
PreparedStatement stm = null;
conn.setAutoCommit(false);
for(int c=1;c<100000;c++){
stm = conn.prepareStatement("INSERT INTO INDEXKEY1
VALUES(?,'DEPOSITO',1,1)"); //this is line number 302. The ERROR LINE.
stm.setInt(1,c);
stm.executeUpdate();
if (c%1000==0){
conn.commit();
System.out.println(c);
}
}
}
catch (SQLException ex){
ex.printStackTrace();
}
}
---8<---8<---8<---8<---8<---8<
It runs ok. But running to many times it rise an exception. For example, it
prints...
1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000
15000 16000
org.firebirdsql.jdbc.FBSQLException: GDS Exception. invalid request
handle at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
at
org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:223)
at importer.MainFrame.jButton1_actionPerformed(MainFrame.java:302)
---8<---8<---8<---8<---8<---8<
Any idea ??
thanks,
yerman
I am sending the piece of java code which produce the error using Firebird...
---8<---8<---8<---8<---8<---8<
void jButton1_actionPerformed(ActionEvent e) {
try{
Connection conn =
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:C:/home/diegoY/DOCTEC/Importerv1.0.4.1/DBDOCTEC.GDB",
"sysdba", "masterkey");
PreparedStatement stm = null;
conn.setAutoCommit(false);
for(int c=1;c<100000;c++){
stm = conn.prepareStatement("INSERT INTO INDEXKEY1
VALUES(?,'DEPOSITO',1,1)"); //this is line number 302. The ERROR LINE.
stm.setInt(1,c);
stm.executeUpdate();
if (c%1000==0){
conn.commit();
System.out.println(c);
}
}
}
catch (SQLException ex){
ex.printStackTrace();
}
}
---8<---8<---8<---8<---8<---8<
It runs ok. But running to many times it rise an exception. For example, it
prints...
1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 11000 12000 13000 14000
15000 16000
org.firebirdsql.jdbc.FBSQLException: GDS Exception. invalid request
handle at
org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:81)
at
org.firebirdsql.jdbc.FBConnection.prepareStatement(FBConnection.java:223)
at importer.MainFrame.jButton1_actionPerformed(MainFrame.java:302)
---8<---8<---8<---8<---8<---8<
Any idea ??
thanks,
yerman