0

I need to do some DB operations on a paradox database from within java code

(I didn't even know about the existance of paradox)

So i downloaded this driver as found out here: https://github.com/leonhad/paradoxdriver, and created a code to query the paradox DB. It works fine.

But when i try to delete some record on the same table where i can succesfully do selects, i get this error:

java.sql.SQLFeatureNotSupportedException: Unsupported operation.

The SQL is executed with "myStatement.execute(delete)" command, and it's the following:

delete from mytable where field1 = 3 or field1= 4

I'm quite confused, beacuse when connecting to the DB using the driver, I'm not giving any username/password, just

Class.forName("com.googlecode.paradox.Driver");
java.sql.Connection conn = DriverManager.getConnection("jdbc:paradox:./db");

Does this driver not allow delete operations?

Maik
  • 811
  • 3
  • 22
  • 35

2 Answers2

1

If you look at the code for the driver the executeUpdate() method is not implemented. Use execute() instead.

Also check your connection object with isReadOnly(), if it is read only try using setReadOnly(false).

EDIT

After more digging in the source code it looks like this driver has not implemented delete yet. It would be better to find another driver.

mwarren
  • 759
  • 3
  • 6
  • Thanks for the hint, but still not working (I have edited the original question) – Maik Sep 30 '19 at 07:03
  • The connection was read only. I have modified it with the command you suggested, but I still get the same error (java.sql.SQLFeatureNotSupportedException: Unsupported operation.) – Maik Sep 30 '19 at 12:54
  • @Maik Are you still trying to use executeUpdate() because that will still not work. Use execute(). – mwarren Sep 30 '19 at 13:02
  • No I'm using execute as you suggested: String delete = "delete from mytable where field1 = 3 or field1= 4"; boolean esito = statTC.execute(delete); – Maik Sep 30 '19 at 14:50
  • @Maik Digging deeper into the source code it look like nothing but select has been implemented. I suggest you find a different driver. – mwarren Sep 30 '19 at 14:57
  • That's really unfortunate. I have searched the web but can't seem to find anything else =( – Maik Oct 01 '19 at 10:10
0

The driver you are trying to use is incomplete, I have tried it too. The developer said two or three months ago that he would rewrite the driver (I need join select statement that doesn't work). The best paradox driver I found is http://www.hxtt.com/paradox.html, but it's not free. However it can be used for no more than 50 queries at once. Now I use the jdbc-odbc driver which is fine. It was removed in Java 8 but still can be used: https://stackoverflow.com/a/36875001/12298400.

itudor
  • 13
  • 4