public JpaDao() {
		boolean create = false;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			Connection connection = DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/", "carletti", "carletti");

			Statement stmt = connection.createStatement();
			try {
				stmt.executeUpdate("USE carletti;");
				ResultSet rs = stmt
						.executeQuery("SELECT * from users LIMIT 1;");
				if (!rs.next()) throw new Exception("RECREATE!!!");
				System.out.println("Database exists!");
			}
			catch (Throwable e) {
				stmt.executeUpdate("DROP DATABASE IF EXISTS carletti;");
				stmt.executeUpdate("CREATE DATABASE carletti;");
				stmt.executeUpdate("USE carletti;");
				System.out.println("Database created!");
				create = true;
			}

		}
		catch (Exception e) {
			System.out.println("Error interacting with database:  "
					+ e.getMessage());
		}
		emf = Persistence.createEntityManagerFactory("Carletti");
		em = emf.createEntityManager();
		tx = em.getTransaction();
		if (create) createSomeObjects();
	}