Guest User

Untitled

a guest
Dec 9th, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. public class ConexaoBanco {
  2. public static Connection conexaoBanco()throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException{
  3. Class.forName("com.mysql.jdbc.Driver");
  4. final String DATABASE_URL = "jdbc:mysql://localhost:3306/teste?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC";
  5. final String ROOT = "root";
  6. final String SENHA = "";
  7. Connection conexao = DriverManager.getConnection(DATABASE_URL,ROOT,SENHA);
  8. return conexao;
  9. }
  10. }
Add Comment
Please, Sign In to add comment