Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Simple example of JDBC insert?

Featured Replies

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

  • Author
  • Newbies

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

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.