Accessing a Paradox table whose name consists of numbers

Accessing a Paradox table whose name consists of numbers

I have installed the driver Read more. Next, I specified the path to the table, but an error appears when creating the query, because the table name consists entirely of numbers.

Connection conn = DriverManager.getConnection("jdbc:paradox:C:/Files");
Statement statement = conn.createStatement();
ResultSet resultSet = statement.executeQuery("select 'date' from 02272217 limit 5");

How is it possible to circumvent this limitation?

I tried inserting a letter at the beginning of the file name, then everything works fine. However, I need to work with the original file names.

Answer

The SQLParser for that project seems to support quoting identifiers with double quotes. This should work:

statement.executeQuery("select 'date' from \"02272217\" limit 5");

Enjoyed this article?

Check out more content on our blog or follow us on social media.

Browse more articles