Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package it.cineca.alt;
- import java.sql.SQLException;
- 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());
- Persona p = new Persona(5 , "pietro", "fu", "fuuu", "123", new java.sql.Timestamp(new java.util.Date().getTime()));
- d.insertPersona(p);
- d.getPersona(1);
- } catch (Exception e) {
- e.printStackTrace();
- }
- finally {
- cf.close();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement