Advertisement
Guest User

Untitled

a guest
Jun 29th, 2018
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. import java.sql.*;
  2. import java.util.Vector;
  3.  
  4. public class DBConnect {
  5.  
  6. private Connection con;
  7. private Statement st;
  8. private ResultSet rs;
  9.  
  10. public DBConnect() {
  11. try {
  12. Class.forName("com.mysql.jdbc.Driver");
  13. con = DriverManager.getConnection("jdbc:mysql://localhost:3306/beispiel","root","");
  14. st = con.createStatement();
  15.  
  16. } catch(Exception e) {
  17. System.out.println("Err: "+e);
  18.  
  19. }
  20. import java.util.*;
  21.  
  22. public class Main {
  23.  
  24. public static void main(String[] args) {
  25. DBConnect connect = new DBConnect();
  26. //ArrayList dbArtikel = connect.getData();
  27. //System.out.println(dbArtikel); // Nope :D na dann gl & hf
  28.  
  29. }
  30.  
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement