Subject | org.firebirdsql.jdbc.FBSQLException - I/O error during "CreateFile (open)" |
---|---|
Author | alzoid2003 |
Post date | 2003-04-03T13:57:13Z |
I have a Java app that is adding a new record to the database. I can
execute SELECTs no problem but when I try to insert I get this error:
org.firebirdsql.jdbc.FBSQLException: Resource Exception. I/O error
during
"CreateFile (open)" operation for Al/pool/Swimming.gdb"
Error while trying to open file
null
Reason: I/O error during "CreateFile (open)" operation for file
"Al/pool/Swimming.gdb"
Error while trying to open file
null
I'm pretty sure this is a Firebird issue but here is my code:
if(validateForm()) {
//String sql = "Select * From Student";
String sql = "INSERT INTO Student
(mcp,first_name,last_name,mid_inital,birthday,pobox,street,town,provin
ce,pos
t_code,phone1,phone2,emerg_contact,phone_contact,medical) VALUES('" +
jtfArray[0].getText() + "','" + jtfArray[1].getText() + "','" +
jtfArray[2].getText() +
"','" + jtfArray[3].getText() + "','" + jtfArray[4].getText() + "',"
+
jtfArray[5].getText() +
",'" + jtfArray[6].getText() + "','" + jtfArray[7].getText() + "','" +
jcbProv.getSelectedItem() +
"','"+ jtfArray[8].getText() + "','" + jtfArray[9].getText() + "','" +
jtfArray[10].getText() + "','" +
jtfArray[11].getText() + "','" + jtfArray[12].getText() + "','" +
jtfArray[13].getText() + "')";
try{
System.out.println(sql);
Class.forName("org.firebirdsql.jdbc.FBDriver");
DriverManager.registerDriver(new org.firebirdsql.jdbc.FBDriver());
Connection con = DriverManager.getConnection(url,"sysdba","pass");
con.setAutoCommit(false);
Statement s = con.createStatement();
//s.addBatch("CONNECT 'Swimming.gdb' USER 'sysdba' PASSWORD 'pass'");
//s.addBatch(sql);
//s.execute("CONNECT 'Swimming.gdb' USER 'sysdba' PASSWORD 'pass'");
//int[] updateCounts = s.executeBatch();
s.executeUpdate(sql);
}
catch(SQLException SQL) { System.out.println(SQL);}
catch(ClassNotFoundException cnf) { System.out.println(cnf);}}
This error has stumped me. Any advice will be appreciated
Thanks
Al
execute SELECTs no problem but when I try to insert I get this error:
org.firebirdsql.jdbc.FBSQLException: Resource Exception. I/O error
during
"CreateFile (open)" operation for Al/pool/Swimming.gdb"
Error while trying to open file
null
Reason: I/O error during "CreateFile (open)" operation for file
"Al/pool/Swimming.gdb"
Error while trying to open file
null
I'm pretty sure this is a Firebird issue but here is my code:
if(validateForm()) {
//String sql = "Select * From Student";
String sql = "INSERT INTO Student
(mcp,first_name,last_name,mid_inital,birthday,pobox,street,town,provin
ce,pos
t_code,phone1,phone2,emerg_contact,phone_contact,medical) VALUES('" +
jtfArray[0].getText() + "','" + jtfArray[1].getText() + "','" +
jtfArray[2].getText() +
"','" + jtfArray[3].getText() + "','" + jtfArray[4].getText() + "',"
+
jtfArray[5].getText() +
",'" + jtfArray[6].getText() + "','" + jtfArray[7].getText() + "','" +
jcbProv.getSelectedItem() +
"','"+ jtfArray[8].getText() + "','" + jtfArray[9].getText() + "','" +
jtfArray[10].getText() + "','" +
jtfArray[11].getText() + "','" + jtfArray[12].getText() + "','" +
jtfArray[13].getText() + "')";
try{
System.out.println(sql);
Class.forName("org.firebirdsql.jdbc.FBDriver");
DriverManager.registerDriver(new org.firebirdsql.jdbc.FBDriver());
Connection con = DriverManager.getConnection(url,"sysdba","pass");
con.setAutoCommit(false);
Statement s = con.createStatement();
//s.addBatch("CONNECT 'Swimming.gdb' USER 'sysdba' PASSWORD 'pass'");
//s.addBatch(sql);
//s.execute("CONNECT 'Swimming.gdb' USER 'sysdba' PASSWORD 'pass'");
//int[] updateCounts = s.executeBatch();
s.executeUpdate(sql);
}
catch(SQLException SQL) { System.out.println(SQL);}
catch(ClassNotFoundException cnf) { System.out.println(cnf);}}
This error has stumped me. Any advice will be appreciated
Thanks
Al