使用JDBC连接oracle,出现java.sql.SQLException: ORA-00911: 无效字符错误,只因query语句中加了一个分号引起,将nyr='20080101';"的分号去除即可。

    String query=" select * from dm_mpg_test where nyr='20080101';";
    ResultSet re=null;
    try {
      re=statement.executeQuery(query);
    } catch (SQLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }