package druidConnect;
|
|
import java.sql.*;
|
import java.util.LinkedHashMap;
|
import java.util.LinkedList;
|
|
public class getMeterParatermeter {
|
public static void main(String[] args) throws Exception {
|
LinkedList<LinkedHashMap> a=getMeterParater();
|
System.out.println(a);
|
}
|
public static LinkedList<LinkedHashMap> getMeterParater() throws Exception {
|
Connection con = druidConnect.JDBCUtils.getConnection();
|
CallableStatement cs =con.prepareCall("call AXJ_a_meter_paramenter()");
|
ResultSet rs = cs.executeQuery();
|
ResultSetMetaData rsmd = rs.getMetaData();
|
String[] arr;
|
LinkedList<LinkedHashMap> results = new LinkedList<LinkedHashMap>();
|
|
while(rs.next()){
|
LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
|
for(int i=0;i<rsmd.getColumnCount();i++){
|
String val=rs.getString(i+1)!=null?String.valueOf(rs.getString(i+1)):"";
|
result.put(String.valueOf(rsmd.getColumnName(i+1)),val);
|
}
|
results.add(result);
|
}
|
druidConnect.JDBCUtils.close(cs, con);
|
return results;
|
}
|
public static void meterToMysql(String meterid,Double meter,String DLT645) throws Exception {
|
Connection con = druidConnect.JDBCUtils.getConnection();
|
CallableStatement cs =con.prepareCall("call AXJ_a_addMeter(?,?,?)");
|
cs.setString(1, meterid);
|
cs.setDouble(2, meter);
|
cs.setString(3, DLT645);
|
cs.executeQuery();
|
druidConnect.JDBCUtils.close(cs, con);
|
}
|
|
public static LinkedList<LinkedHashMap> getOrderOpt() throws Exception {
|
Connection con = druidConnect.JDBCUtils.getConnection();
|
CallableStatement cs =con.prepareCall("call AXJ_a_get_orderRecipeOpt_select()");
|
ResultSet rs = cs.executeQuery();
|
ResultSetMetaData rsmd = rs.getMetaData();
|
String[] arr;
|
LinkedList<LinkedHashMap> results = new LinkedList<LinkedHashMap>();
|
|
while(rs.next()){
|
LinkedHashMap<String, String> result = new LinkedHashMap<String, String>();
|
for(int i=0;i<rsmd.getColumnCount();i++){
|
String val=rs.getString(i+1)!=null?String.valueOf(rs.getString(i+1)):"";
|
result.put(String.valueOf(rsmd.getColumnName(i+1)),val);
|
}
|
results.add(result);
|
}
|
druidConnect.JDBCUtils.close(cs, con);
|
return results;
|
}
|
}
|