0

如何使用 JDBC 执行在子句INSERT中有用户定义的 PL/SQL 函数的VALUES语句?

INSERT INTO table_name VALUES (plsql_func_name('?'),?,?,?);

应该使用prepareStatement()还是callablestatement()使用?

4

1 回答 1

1

The apostrophes around the parameter are your undoing. Try it this way:

INSERT INTO table_name VALUES (plsql_func_name(?),?,?,?);

Remember that the apostrophes are handled by the prepared statement, as this is one of its main jobs (as it has to prevent potential SQL-injections as well).

于 2014-03-02T13:05:28.237 回答