StringBuffer str = new StringBuffer("select * from menu where parentid=1 and mid<>1 order by parentid");
List list = new ArrayList();
ResultSet rst = null;
DataBaseConnection dbc = null;
PreparedStatement pstm = null;
try {
dbc = new DataBaseConnection();
pstm = dbc.getConnection().prepareStatement(str.toString());
rst = dbc.query(pstm);
while(rst.next()){
System.out.println(rst.getString("name"));
}
RST中没有任何值数据库 ORACLE 10G
List list = new ArrayList();
ResultSet rst = null;
DataBaseConnection dbc = null;
PreparedStatement pstm = null;
try {
dbc = new DataBaseConnection();
pstm = dbc.getConnection().prepareStatement(str.toString());
rst = dbc.query(pstm);
while(rst.next()){
System.out.println(rst.getString("name"));
}
RST中没有任何值数据库 ORACLE 10G
为什么不直接查询呢?
try {
dbc = new DataBaseConnection();
pstm = dbc.getConnection().prepareStatement(str.toString());
rst = pstm.executeQuery();
while(rst.next()){
System.out.println(rst.getString("name"));
}
Exception { this.rst = pstm.executeQuery();
return rst;
}这是后台查询
你的sql在工具里能查出东西吗?
public ResultSet query(PreparedStatement pstm) throws SQLException,
Exception {
return pstm.executeQuery();
}
有结果吗?
select * from menu where parentid=1 and mid <>1 order by parentid
dbc.query(pstm); 是什么玩意?
没用过,LZ可以试试
在PLSQL DEVELOPER中能出来结果
你把这个删了看好使不
如果用PLSQL DEVELOPER插入数据,默认是不commit的