Java DbUtils MySQL如何在调用存储过程时设置param

时间:2016-10-27 10:28:55

标签: java mysql apache-commons-dbutils

我有一个问题,调用一个程序,我想设置两个paramams。在程序中,第一个参数必须是int和secod时间。我这样做了:

beans = (List) qRunner.query(conn, "call mpklocal.LCD_GetDispInfoChange_TEST(?, CURTIME()  )", timtableId ,
                      new BeanListHandler(AnotherBusInBusStop.class));

当我关闭程序时,我看到了:

Java.sql.SQLException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'SELECT CURTIME())' at line 1 Query: call mpklocal.LCD_GetDispInfoChange_TEST(?,SELECT CURTIME()) Parameters: [657983]
    at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392)
    at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:351)
    at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:180)

0 个答案:

没有答案