Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 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.  
  11. public class DBTest {
  12.     // метод ля получения объекта типа Connection
  13.     public static Connection getConn() throws Exception {        
  14.         String connStr = "jdbc:mariadb://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&user=root&password=";
  15.         return DriverManager.getConnection(connStr);
  16.     }
  17.     //
  18.     public static void main(String[] args) {
  19.         // TODO code application logic here
  20.     }    
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement