Advertisement
Guest User

DanielPedał

a guest
May 21st, 2019
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. package DBConnection;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5. import java.sql.SQLException;
  6.  
  7. /**
  8.  *
  9.  * @author piec
  10.  */
  11. public class dbc {
  12.     public Connection connection = null;
  13.  
  14.     public Connection getConnection() throws SQLException {
  15.         String dbname = "bazakina";
  16.         String userName = "root";
  17.         String password = "";
  18.  
  19.         System.out.println("Driver");
  20.         connection = DriverManager.getConnection("jdbc:mysql://localhost/" + dbname, userName, password);
  21.         System.out.println("połączenie");
  22.  
  23.         return connection;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement