Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 31 2002
Added on Dec 2 2002
7 comments
413 views