Advertisement
Guest User

Untitled

a guest
Nov 11th, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. //DADOS DE LOGIN - BD
  2. private String url = "jdbc:mysql://localhost:3306/school_life?useSSL=false",
  3. usuario = "root",
  4. senha = "root";
  5. private Connection conexao;
  6. private Statement stm;
  7. private ResultSet rs;
  8.  
  9. public void carregaDados(String comando) {
  10. try {
  11. Class.forName("com.mysql.jdbc.Driver");
  12. conexao = DriverManager.getConnection(url, usuario, senha);
  13. stm=conexao.createStatement();
  14. this.rs = stm.executeQuery(comando);
  15. }
  16.  
  17. catch(Exception e) {
  18. e.printStackTrace();
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement