jconnect6 连接sybase iq 15 问题
各位老大,在mysql中下面的代码(?在= 左边的情况)可以运行,而在sybase中报错,有没有哪位兄弟遇到过啊。
Class.forName(driver); Connection connection = DriverManager.getConnection(url,username,password); PreparedStatement statement = connection.prepareStatement("select * from managedaccount where ?=1"); statement.setString(1, "1"); statement.executeQuery();
Exception in thread "main" com.sybase.jdbc3.jdbc.SybSQLException: SQL Anywhere Error -143: Column '@p0' not found at com.sybase.jdbc3.tds.Tds.processEed(Tds.java:3069) at com.sybase.jdbc3.tds.Tds.nextResult(Tds.java:2373) at com.sybase.jdbc3.jdbc.ResultGetter.nextResult(ResultGetter.java:69) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:220) at com.sybase.jdbc3.jdbc.SybStatement.nextResult(SybStatement.java:203) at com.sybase.jdbc3.jdbc.SybStatement.queryLoop(SybStatement.java:1705) at com.sybase.jdbc3.jdbc.SybStatement.executeQuery(SybStatement.java:1690) at com.sybase.jdbc3.jdbc.SybPreparedStatement.executeQuery(SybPreparedStatement.java:97) at Test.main(Test.java:29)