通过Java代码从sql数据库中选择数据。
String sql="SELECT [IRB#] AS IRB_NUMBER, [RefNum] AS STUDY_PK FROM CyberProtocol1 WHERE VelosRequestID = '"+currentRequest+"' AND TranscationStatus = 1";
ResultSet resultSet=executeQuery(sql);
public ResultSet executeQuery(String SQLString) {
logDebugInfo("In executeQuery() function",LOG_TYPE_INFORMATIVE);
ResultSet sqlResultSet = null;
try {
logDebugInfo("SQLString:: " + SQLString,LOG_TYPE_CRITICAL);
executeStatement=gConn.prepareStatement(SQLString);
sqlResultSet=executeStatement.executeQuery();
return sqlResultSet;
} catch (Exception errorException) {
processException(errorException, false);
}
return sqlResultSet;
}
得到异常是:java.sql.SQLSyntaxErrorException:ORA-00936:缺少表达式