Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 7966 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

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!!

  • Newbies
Posted

Nevermind i figured it out, I had a space in the table name where i shouldnt have. (blush.gif)

Anyway, in case anyone else needs to know what method to use, use the PreparedStatement with conn.preparestatement and not statement.executeQuery!!!

This topic is 7966 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.