January 30, 200322 yr Newbies Can someone post a short quick example of how to do a simple insert into FM Pro 6? Every time I try to do a simple insert (1 column) it says "Database closed" however as soon as I replace the SQL with an update, it works fine. Why does it say the databse is closed when I try to do an insert but works OK with an update?!? I tried: <standard conection stuff> Connection conn=DriverManager.getConnection(...) PreparedStatement ps=conn.prepareStatement("INSERT INTO "DATABASE.FP5" ("CUSTOMER") VALUES ('JOHN')"); ps.executeUpdate(); Is this correct to use a prepared statement with an executeUpdate? Or should I use a regular statement and do a statement.executeQuery() (actually i tried this and it didnt work either, but... im still not sure which way to fiddle around with more.) Any help appreciated, this is driving me nuts and this project is supposed to be done next week. Thanks!!
January 30, 200322 yr Author Newbies Nevermind i figured it out, I had a space in the table name where i shouldnt have. () Anyway, in case anyone else needs to know what method to use, use the PreparedStatement with conn.preparestatement and not statement.executeQuery!!!
Create an account or sign in to comment