I've recently updated to 043 pure java, the problem is that If I
choose to insert data into my db I get always cannot commit
transaction - SQL statements in progress, I tried also with using
executeBatch instead of executeUpdate() disabling and re-enabling
autocommit but doing this gets me to "SQL logic error or missing
database" error .
The method I wrote for inserting a record is this :
public synchronized void insertPalestra(String nome, String indirizzo)
        {

                p.lock=true;
                boolean iw=true;
                try{PreparedStatement insertP= conn.prepareStatement("INSERT 
INTO
Palestra VALUES ( ? , ?, ?)");
            insertP.setInt(1, p.idP);
            insertP.setString(2, nome);
            insertP.setString(3, indirizzo);
            insertP.addBatch();
            conn.setAutoCommit(false);
        insertP.executeBatch();
        conn.setAutoCommit(true);
           //insertP.executeUpdate();
            p.idP++;
                }catch(SQLException sqle){sqle.printStackTrace();iw=false;}
                if(p.msg){if(iw)w.showMsg(JOptionPane.INFORMATION_MESSAGE, 
"Palestra
inserita correttamente", "Palestra Inserita");
                else w.showMsg(JOptionPane.ERROR_MESSAGE, "Palestra non inserita
correttamente", "Errore Inserimento");}
                p.lock=false;
        }

What should I do?
What should I do?
--~--~---------~--~----~------------~-------~--~----~
Mailing List: http://groups.google.com/group/sqlitejdbc?hl=en
To unsubscribe, send email to [EMAIL PROTECTED]
-~----------~----~----~----~------~----~------~--~---

Reply via email to