Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package dbUtil;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class dbConnection {
- private static final String USERNAME = "szpital";
- private static final String PASSWORD = "szpital";
- private static final String SQCONN = "jdbc:oracle:thin:@localhost:1521:xe";
- public static Connection getConnection() throws SQLException{
- try{
- Class.forName("oracle.jdbc.driver.OracleDriver");
- return DriverManager.getConnection(SQCONN, USERNAME, PASSWORD);
- }catch (SQLException ex) {
- System.out.println("Cos poszlo nie tak: " + ex.getMessage());
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement