Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.sql.DriverManager;
- import java.sql.PreparedStatement;
- import java.sql.SQLException;
- import java.sql.Connection;
- public class getInfoDBemp {
- private static final String JDBC_URL = "jdbc:derby:EvCo-RegHuella;";
- Connection conn;
- public getInfoDBemp () {
- try {
- this.conn = DriverManager.getConnection(JDBC_URL);
- if (this.conn != null) {
- try {
- PreparedStatement ps = this.conn.prepareStatement(main.statementEmpreg);
- ps.execute();
- while (ps.getMoreResults()) {
- String testprint = ps.getResultSet().toString();
- System.out.println(testprint);
- }
- ps.close();
- }catch(SQLException ex){
- String exString = ex.toString();
- System.out.println("ERROR " + exString);
- }
- }
- }catch (SQLException e) {
- System.out.print(e);
- }
- }
- }
Add Comment
Please, Sign In to add comment