Advertisement
Guest User

Untitled

a guest
Dec 11th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. package produtos;
  2.  
  3. import java.sql.Connection;
  4. import java.sql.DriverManager;
  5.  
  6. public class ConnectionFactory {
  7.    
  8.     public Connection getConnection(){
  9.        
  10.         try {
  11.             Class.forName("com.mysql.jdbc.Driver");
  12.             return DriverManager.getConnection(
  13.                     //"jdbc:mysql://35.223.2.93:3306/"
  14.                     "jdbc:mysql://mysqltrab.mysql.database.azure.com:3306/"
  15.                     + "main?useTimezone=true&serverTimezone=America/"
  16.                     + "Sao_Paulo",
  17.                     "spati@mysqltrab", "102030Gui!");
  18.         } catch (Exception e) {
  19.             throw new RuntimeException(e);
  20.         }
  21.        
  22.     }
  23.  
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement