Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DataBaseConnection {
- private Connection con;
- protected Statement st;
- protected ResultSet rs;
- public DataBaseConnection() {
- try {
- Class.forName("com.mysql.jdbc.Driver");
- con = DriverManager.getConnection("jdbc:mysql://localhost/bilete", "root", "");
- st = con.createStatement();
- st.executeUpdate("INSERT INTO Clienti VALUES('C1','Bejan Isaia','VIP')");
- con.close();
- } catch (Exception ex) {
- System.out.println("Error: " + ex);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement