Subject | RE: [ib-support] firebird insertion error |
---|---|
Author | Svein Erling Tysvaer |
Post date | 2003-04-10T10:09:18Z |
I know nothing about Java, but to me it seems like you are preparing the
statement for each iteration - something you should avoid. Try changing to
...
conn.setAutoCommit(false);
stm = conn.prepareStatement("INSERT INTO INDEXKEY1
VALUES(?,'DEPOSITO',1,1)"); //this is line number 302. The ERROR LINE.
for(int c=1;c<100000;c++){
stm.setInt(1,c);
...
HTH,
Set
At 15:45 09.04.2003 -0300, you wrote:
statement for each iteration - something you should avoid. Try changing to
...
conn.setAutoCommit(false);
stm = conn.prepareStatement("INSERT INTO INDEXKEY1
VALUES(?,'DEPOSITO',1,1)"); //this is line number 302. The ERROR LINE.
for(int c=1;c<100000;c++){
stm.setInt(1,c);
...
HTH,
Set
At 15:45 09.04.2003 -0300, you wrote:
>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
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/