java代码报错: SQL Error: 942, SQLState: 42000 ORA-00942: 表或视图不存在
publicList<Object>getStreetInfo(){StringBuilderhqlStr=newStringBuilder("selectGRID_SY...
public List<Object> getStreetInfo(){
StringBuilder hqlStr = new StringBuilder("select GRID_SYSDB.MNG_JD_M.CODE as CODE FROM GRID_SYSDB.MNG_JD_M");
List<Object> list = new ArrayList<Object>();
Session session = null;
try {
session = hibernateHelper.getSession();
SQLQuery query = session.createSQLQuery(hqlStr.toString());
query.addScalar("CODE", Hibernate.STRING);
list = query.list();
} catch (Exception ex) {
ex.printStackTrace();
}
return list;
}
数据库中用同样查询语句可以查到值的。 展开
StringBuilder hqlStr = new StringBuilder("select GRID_SYSDB.MNG_JD_M.CODE as CODE FROM GRID_SYSDB.MNG_JD_M");
List<Object> list = new ArrayList<Object>();
Session session = null;
try {
session = hibernateHelper.getSession();
SQLQuery query = session.createSQLQuery(hqlStr.toString());
query.addScalar("CODE", Hibernate.STRING);
list = query.list();
} catch (Exception ex) {
ex.printStackTrace();
}
return list;
}
数据库中用同样查询语句可以查到值的。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询