1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
public boolean fetch(IDataSetInstance dataSet, IUpdatableDataSetRow row) {
try {
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
Connection conn ;
conn = DriverManager.getConnection ("jdbc:mysql://10.111.90.31:3306/tudu", "root", "admin");
Statement st = conn.createStatement();
ResultSet res = st.executeQuery("SELECT * FROM operation");
while (res.next()) {
row.setColumnValue("count", count);
row.setColumnValue("operation", res.getString(2));
}
if (count < 10) {
//row.setColumnValue("count", count);
count++;
return true;
} |
Partager