publicstaticListgetSystemParaList()throwsSQLException{Listout_list=newArrayList();DbUtils.loadDriver("oracle.jdbc.driver.OracleDriver");Connectionconn=DriverManag...
public static List getSystemParaList() throws SQLException{
List out_list = new ArrayList();
DbUtils.loadDriver("oracle.jdbc.driver.OracleDriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521/orcl", "bshare", "bshare");
String sql = "select PARA_NAME,PARA_SYS_DEFAULT_VALUE,PARA_USER_SET_VALUE from T_LX_SYS_PARAMETER_REG where PARA_SYSTEM like ?";
PreparedStatement prep = conn.prepareStatement(sql);
prep.setString(1,"LX%");
ResultSet rs = prep.executeQuery();
//ResultSetMetaData rsmd = prep.getParameterMetaData();
//int column = rs.getMetaData();
// ResultSetMetaData rsmd = rs.getMetaData();
// int colum = rsmd.getColumnCount();
while(rs.next()){
// String str[] = new String[colum];
out_list.add(rs.getString("PARA_NAME"));
out_list.add(rs.getDouble("PARA_SYS_DEFAULT_VALUE"));
out_list.add(rs.getDouble("PARA_USER_SET_VALUE"));
//将这三个值作为一个对象存入一个数组中
}
prep.close();
conn.close();
return out_list;
}
定义一个数组存放PARA_NAME、PARA_SYS_DEFAULT_VALUE、PARA_USER_SET_VALUE这三个对象的值
展开