getParameterMetaData() in 2005 JDBC Driver behaves unexpectedly

I'm using the 2005 driver against an

instance of SQLServer2000. The following works just

fine:

PreparedStatement s =

conn.prepareStatement("select s.spid from master.dbo.sysprocesses s where dbid =

?");

s.getParameterMetaData();

Howerver, when I prefix the search

column with the table alias like this:

PreparedStatement s =

conn.prepareStatement("select s.spid from master.dbo.sysprocesses s where s.dbid

= ?");

s.getParameterMetaData();

I get the following

exception:

Exception in thread "main"

com.microsoft.sqlserver.jdbc.SQLServerException:

com.microsoft.sqlserver.jdbc.SQLServerException:

The column prefix 's' does

not match with a table name or alias

name used in the query.

Am I using the method incorrectly,

or is this a known bug in the driver?

Thank

you,

Zach

[2399 byte] By [zheidepriem] at [2007-12-22]

SQL Server

Site Classified