Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package it.marconivr.DAOManager;
- import java.sql.*;
- public class DAOMan {
- // tutte le classi DAO per ogni tabella
- public static ActorDAO actorDAO = new ActorDAOImpl();
- public static FilmDAO filmDAO = new FilmDAOImpl();
- public static LanguageDAO languageDAO = new LanguageDAOImpl();
- public static Connection initConn() {
- Connection conn = null;
- // la stringa di connessione deve essere PERSONALIZZATA
- String url = "jdbc:postgresql://172.16.1.99/pagila";
- try {
- Class.forName("org.postgresql.Driver");
- conn = DriverManager.getConnection(url, "pagila", "pagila");
- } catch (Exception ex) {
- System.out.println(ex);
- }
- return conn;
- }
- // La connessione deve essere chiusa dopo l'uso
- public static Connection getConnection() {
- return initConn();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement