Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package demo;
- import java.sql.Connection;
- import java.sql.DriverManager;
- import java.sql.ResultSet;
- import java.sql.ResultSetMetaData;
- import java.sql.SQLException;
- import java.sql.Statement;
- public class Main {
- public static void main(String[] args) throws SQLException {
- ConnectionFactory cf = new ConnectionFactory("jdbc:mysql://localhost:3306/sakila", "root", "alternanza");
- try {
- Class.forName("com.mysql.jdbc.Driver");
- Dao d = new Dao(cf.getConnection());
- d.execute();
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally {
- cf.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement