try{
Class.forName("oracle.jdbc.driver.OracleDriver");
}catch(Exception ex){}
}
public static Connection getConn() {
try {
String url= "jdbc:oracle:thin:@192.168.0.88:1521:orcl";
String user="yhqjcpt";
String password="yhqjcpt";
return DriverManager.getConnection(url,user,password);
} catch (Exception ex) {
ex.printStackTrace();
return null;
}
}
public List userServer(String isOnline, String isUnusual,String userId,String code,String jddz,String userName){
Statement stmt;
ResultSet rs;
System.err.println(" isUnusual "+isUnusual);
List<Map<String,Object>> list=new ArrayList<Map<String,Object>>();
try {
stmt = getConn().createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
String sql ="";
rs = stmt.executeQuery(sql);
Map<String,Object> map;
ResultSetMetaData rsmd;
while(rs.next()){
map=new HashMap<String,Object>();
rsmd =(ResultSetMetaData)rs.getMetaData();
for (int i=1;i<=rsmd.getColumnCount();i++) {
map.put(rsmd.getColumnName(i), rs.getObject(i));
}
list.add(map);
}
} catch (SQLException e) {
e.printStackTrace();
}
return list;
}