Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package test;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- public class LoadDriver {
- public static Connection getConnection(){
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Connection conn = DriverManager.getConnection("jdbc:mysql://dt5.ehb.be/1718OOAJAVA017","1718OOAJAVA017","37692581");
- conn.setAutoCommit(false);
- return conn;
- } catch (SQLException ex) {
- // handle any errors
- System.out.println("SQLException: " + ex.getMessage());
- System.out.println("SQLState: " + ex.getSQLState());
- System.out.println("VendorError: " + ex.getErrorCode());
- } catch (ClassNotFoundException e) {
- e.printStackTrace();
- }
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement