1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| package mypack;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
public class Ap {
public ResultSet inv() {
ResultSet re = null;
try {
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost:3306/slim","root","");
PreparedStatement st = con.prepareStatement("select idrule from rule");
re= st.executeQuery();
} catch (Exception e) {
System.out.println(e.getMessage());
}
return re;
}
} |
Partager