JDBC-ODBC and weird field names
843854Dec 2 2002 — edited Dec 3 2002(corrected typing)
Sorry to ask a beginner's question but I am trying to use JDBC and the
JDBC-ODBC bridge to access a Access 2002 .mdb file.
Unfortunately a few of the tables have column names that end in question
mark ("?") such as a columns called "Speak?".
I can use SQL in Access 2002 to reference this field as [Speak?] as in
SELECT ContactID FROM ConLang WHERE ConLang.[Speak?]=true;
I've tried the following using JDBC:
String query = "SELECT ContactID FROM ConLang WHERE ConLang.\"Speak?
\"=7; ";
JDBC returns an error for this query complaining about "too few parameters".
I don't want to rename the fields as the schema isn't mine. Is there any way to work around the use of question mark in the field name or escape it so that it is not interpreted as a paramater?