ResultSet rs = null;
Connection con = null;
Statement stmt = null;
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection("jdbc:mysql://localhost/hr?useUnicode=true&characterEncoding=UTF8","root", "root");
stmt = con.createStatement();
String sqlString=" select mpfceiling, mpffloor, mpfpercent from companyProfile;";
rs = stmt.executeQuery(sqlString);
int mMPFCeiling=0;
int mMPFFloor=0;
int mMPFPercent=0;
while (rs.next()){
mMPFCeiling=rs.getInt(1);
mMPFFloor=rs.getInt(2);
mMPFPercent=rs.getInt(3);
}
沒有留言:
張貼留言