日期:2014-05-17  浏览次数:20989 次

query error:ORA-00911: 无效字符
在运行这句的时候出现的ResultSet rs = dbc.executeQuery(sql);

private ConnOracle dbc = new ConnOracle();

public ResultSet executeQuery(String sql) {
  try {
  rs = getStatement().executeQuery(sql);
  } catch (SQLException ex) {
  System.err.println("query error:" + ex.getMessage());
  }
  return rs;
  }

------解决方案--------------------
ORA-00911 invalid character

Cause: Special characters are valid only in certain places. If special characters other than $, _, and # are used in a name and the name is not enclosed in double quotation marks ("), this message will be issued. One exception to this rule is for database names; in this case, double quotes are stripped out and ignored.

Action: Remove the invalid character from the statement or enclose the object name in double quotation marks.


------解决方案--------------------
把sql语句的内容贴到oracle 中运行一下就知道是哪里有问题了!
------解决方案--------------------
SQL?
引用楼主 wqfwuliao 的帖子:
在运行这句的时候出现的ResultSet rs = dbc.executeQuery(sql);

private ConnOracle dbc = new ConnOracle();

public ResultSet executeQuery(String sql) {
try {
rs = getStatement().executeQuery(sql);
} catch (SQLException ex) {
System.err.println("query error:" + ex.getMessage());
}
return rs;
}