Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package Control;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- *
- * @author theInterloper
- */
- public class DBConnector {
- public Connection setUpConnection() throws SQLException {
- String driver= ("com.mysql.jdbc.Driver");
- String url = "jdbc:mysql://mysql972.cp.blacknight.com/db1075072_craftShop";
- Connection connection = DriverManager.getConnection(url,"u1075072_maker", "9791513782");
- try {
- // Load database driver if not already loaded.
- Class.forName(driver);
- } catch(ClassNotFoundException cnfe) {
- System.err.println("Error loading driver: " + cnfe);
- }
- return connection;
- }
- }
Add Comment
Please, Sign In to add comment