Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getParameterMetaData bug?

92 views
Skip to first unread message

jat5

unread,
Aug 11, 2009, 3:41:01 PM8/11/09
to
Is there still a bug with the driver and the getPareameterMetaData call when
the query in question contains an aliased table that has a column that needs
to be set to a parameter? I seem to be encountering this issue:

query...

select p.id, p.name
from person p
where p.age = ?


the java code...

PreparedStatement ps = conn.prepareStatement(sql);
ps.getParamterMetaData(); // THIS THROWS AN EXCEPTION

Is this a bug? If not, is there a workaround (apart from not using table
aliases, that DOES work)?

Mugunthan Mugundan

unread,
Aug 11, 2009, 4:36:01 PM8/11/09
to
Our parser currently does not support aliases. We will look into extending
our parser to support aliases in one of our future releases.

Watkin@discussions.microsoft.com James Watkin

unread,
Aug 27, 2009, 12:13:01 AM8/27/09
to
I'm getting stmt.getParameterMetaData() exceptions with simple queries like
the following:

java.sql.SQLException: com.microsoft.sqlserver.jdbc.SQLServerException:
Incorrect syntax near the keyword 'FROM'. Query: SELECT program FROM
programs WHERE (code = ?) Parameters: [MFE]

Is your driver supposed to work with these simpler queries?

The latest version of the Apache Commons DBUtils, version 1.2, requires a
working stmt.getParameterMetaData() method. There's a chance they could
implement a workaround for drivers that don't implement this method. So if
you can't urgently fix your driver to make it fully work with the
stmt.getParameterMetaData() method, perhaps you should consider urgently
releasing an update that declares the stmt.getParameterMetaData() as
unimplemented.

Respectfully,
Jim

Sreekanth Nadendla

unread,
Sep 8, 2009, 2:14:45 PM9/8/09
to
This exception java.sql.SQLException with message "Incorrect syntax near
the keyword 'FROM'" for a query such as the following seems to be a bug in
the JDBC driver.

SELECT program FROM programs WHERE (code = ?)

You may wish to open a support incident with PSS if you want to pursue the
possibility of getting a fix for this.

0 new messages