Advertisement
serg_specialist

Untitled

Mar 24th, 2018
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package dbtest;
  7.  
  8. import java.sql.Connection;
  9. import java.sql.DriverManager;
  10. import java.sql.SQLException;
  11.  
  12. /**
  13.  *
  14.  * @author student
  15.  */
  16. public class DBTest {
  17.  
  18.     public static Connection getConnection() throws SQLException {
  19.  
  20.         String connectionString = "jdbc:mariadb://localhost:3306/test01?useUnicode=true&characterEncoding=UTF-8&user=root&password=";
  21.         final Connection connection = DriverManager.getConnection(connectionString);
  22.         return connection;
  23.     }
  24.  
  25.     /**
  26.      * @param args the command line arguments
  27.      */
  28.     public static void main(String[] args) {
  29.         // TODO code application logic here
  30.     }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement