0
Hello, I did a college job using java screens using the ide netbeans, crud the database ,using postgresql as the main database, I was able to finish and everything, however I would like to send only the jar to the teacher, on my computer the jar works, but in another it does not find the database, how do I "load" the database with the application? Obg
my connection
public void Conectabd() throws ClassNotFoundException {
conectdbd();
CriarBd();
}
public static Connection conectdbd() throws ClassNotFoundException {
try {
Class.forName("org.postgresql.Driver");
Connection con = DriverManager.getConnection("jdbc:postgresql://localhost:3306/bdoficina", "postgres", "diego");
return con;
} catch (SQLException error) {
JOptionPane.showMessageDialog(null, error);
return null;
}
}
I believe that there is no way, only if you were using a "portable" bank, such as sqlite, hsqldb.
– user28595
Unless you pay a hosting postgree, and put the bank on the internet.
– user28595
would like the local bank even , has no other type of bank that already integrates the application no?
– Diego Noceli
Yeah, I mentioned two options, but you’d have to rewrite all the tables for him.
– user28595
I recently made an application in Delphi having Postgresql with BD, and used a file
.ini
to make this connection with the bank, so in my connection file I put ashost
the IP of the machine where the bank was saved, another thing I had to change was the file pg_hba.conf in order to be able to access my BD from another machine, but of course this will only work if the computers in question are on the same network in the case– R.Santos
@R.Santos I believe that this is not the case. Note that it will send the work to the teacher, it can open anywhere, it will not work, unless he has an online hosting bank, or set up a dynamic dns to redirect to his pc, which should be on all the time, without counting connection problems that may occur too.
– user28595
@diegofm It’s true, I had not connected to that part of the question when I made the comment
– R.Santos