jdbc获取视图字段名称,长度等信息,这句话怎么得到的resultset为空?
Connectioncon;Stringviewsql="select*fromuser_tab_colsWHEREtable_name='"+viewname+"'";...
Connection con;
String viewsql="select * from user_tab_cols WHERE table_name='"+viewname+"'";
Statement pStemt = null;
try {
try {
Class.forName(DRIVER);
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
con = DriverManager.getConnection(URL, NAME, PASS);
pStemt = (Statement) con.createStatement();
ResultSet rs = pStemt.executeQuery(viewsql); 展开
String viewsql="select * from user_tab_cols WHERE table_name='"+viewname+"'";
Statement pStemt = null;
try {
try {
Class.forName(DRIVER);
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
con = DriverManager.getConnection(URL, NAME, PASS);
pStemt = (Statement) con.createStatement();
ResultSet rs = pStemt.executeQuery(viewsql); 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询