import db.Db;
import db.EntDb;Db db = EntDb.getThinDb("select oid ,name,par_oid,kind from obj_tb limit 50000 ");
是什么意思?没有你的包,没法调,你说是那里报错吧
import db.EntDb;Db db = EntDb.getThinDb("select oid ,name,par_oid,kind from obj_tb limit 50000 ");
是什么意思?没有你的包,没法调,你说是那里报错吧
throws Exception
{
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
conn = DriverManager.getConnection();
String query = "select name, pid from table where id = ? ";
pstmt.setString(1, id);
pstmt = conn.prepareStatement(query);
rs = pstmt.executeQuery();
if (rs.next())
return getPath(rs.getString("id")) + "/" + rs.getString("name");
else
return "";
}
catch (SQLException se)
{
throw new Exception(se);
}
finally
{
if (rs != null)
try { rs.close(); } catch (Exception e) {}
if (pstmt != null)
try { pstmt.close(); } catch (Exception e) {}
if (conn != null)
try { conn.close(); } catch (Exception e) {}
}
}
return getPath(rs.getString("pid")) + "/" + rs.getString("name");
else
return "";
String query = "select name, pid from table where id = ? ";
pstmt.setString(1, id);
pstmt = conn.prepareStatement(query);
rs = pstmt.executeQuery();
if (rs.next())
{
String id = rs.getString("id");
String name = rs.getString("name");
if (name.equals("kkk"))
return name;
else
return getPath(id) + "/" + name;
}
else
{
return "";
}