Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.romanko.olga;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.SQLException;
- /**
- * Created by DELL on 03.12.2016.
- */
- public class DBConnector {
- private final String HOST = "jdbc:mysql://localhost:3306/flatdb";
- private final String USERNAME = "root";
- private final String PASSWORD = "root";
- private Connection connection;
- public DBConnector() {
- try {
- connection = DriverManager.getConnection(HOST, USERNAME, PASSWORD);
- } catch (SQLException e) {
- System.out.printf("Driver not found");
- }
- }
- public Connection getConnection() {
- return connection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement