Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package app.database.driver;
- import java.sql.*;
- /**
- *
- * @author notebook
- */
- public abstract class SqlDriver {
- protected Connection connection;
- protected PreparedStatement preparedStatement;
- protected static final String URL = "jdbc:postgresql://slon.felk.cvut.cz:5432/db17_perinma2", USER = "db17_perinma2", PASSWORD = "db17_perinma2";
- protected boolean openConnection(){
- try{
- Class.forName("org.postgresql.Driver");
- connection = DriverManager.getConnection(URL, USER, PASSWORD);
- return true;
- }
- catch(Exception e){
- return false;
- }
- }
- protected void closeConnection() throws SQLException{
- connection.close();
- }
- public abstract void ExecuteQuery(String sqlstatement);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement