这是我的Java代码:
public class Data{
Connection con = null; Record record = null; public ResultSet getTableInfo(String tableName, String wheStr, String orderField, String orderMethod, int page, int items)
{
this.record = new Record();
ResultSet rs = null;
try
{
DbConnection1 bConnection1=new DbConnection1();
con= bConnection1.initConn1();
CallableStatement cs =getCon().prepareCall("{call gzagritemp.datamanage.getTableInfo(?,?,?,?,?,?,?,?,?)}");
cs.setString(1, tableName);
cs.setString(2, wheStr);
cs.setString(3, orderField);
cs.setString(4, orderMethod);
cs.setInt(5, page);
cs.setInt(6, items);
cs.registerOutParameter(7, 4);
cs.registerOutParameter(8, 4);
cs.registerOutParameter(9, -10);
cs.execute();
this.record.setAllItems(cs.getInt(7));
this.record.setPges(cs.getInt(8));
rs = (ResultSet)cs.getObject(9);
} catch (Exception e) {
e.printStackTrace();
}
return rs;
} public Connection getCon()
{
return this.con;
}
}这是异常信息:
ORA-06550: 第 1 行, 第 7 列:
PLS-00201: 必须声明标识符 'GZAGRITEMP.DATAMANAGE'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored这是数据库存储过程的表格属性:
public class Data{
Connection con = null; Record record = null; public ResultSet getTableInfo(String tableName, String wheStr, String orderField, String orderMethod, int page, int items)
{
this.record = new Record();
ResultSet rs = null;
try
{
DbConnection1 bConnection1=new DbConnection1();
con= bConnection1.initConn1();
CallableStatement cs =getCon().prepareCall("{call gzagritemp.datamanage.getTableInfo(?,?,?,?,?,?,?,?,?)}");
cs.setString(1, tableName);
cs.setString(2, wheStr);
cs.setString(3, orderField);
cs.setString(4, orderMethod);
cs.setInt(5, page);
cs.setInt(6, items);
cs.registerOutParameter(7, 4);
cs.registerOutParameter(8, 4);
cs.registerOutParameter(9, -10);
cs.execute();
this.record.setAllItems(cs.getInt(7));
this.record.setPges(cs.getInt(8));
rs = (ResultSet)cs.getObject(9);
} catch (Exception e) {
e.printStackTrace();
}
return rs;
} public Connection getCon()
{
return this.con;
}
}这是异常信息:
ORA-06550: 第 1 行, 第 7 列:
PLS-00201: 必须声明标识符 'GZAGRITEMP.DATAMANAGE'
ORA-06550: 第 1 行, 第 7 列:
PL/SQL: Statement ignored这是数据库存储过程的表格属性:
grant execute on GZAGRITEMP.DATAMANAGE to GZNYZY
再确认是否有对应权限
select object_type,object_name,owner from dba_objects where lower(object_name) in ('gzagritemp','datamanage','gettableinfo');