chunkII123
IS-IT--Management
Hey yall,
Well, heres a good one for you, this will probably be simple and someone should kick me, whatever. At my company we have two offices, one is in Grand Rapids, one is in Flint (Michigan); anyhow, both locations now have servers, GR had the server first, and it runs MySQL 5.0-community-nt, this runs the backbone of our software. I recently got a server for our flint office and I am making a "shadow" copy of the server here, however I am using their DB (microsoft access migrated to SQL 5.0-community-nt). I made all necessary tables and views that the software calls to, and did a backup/restore from GR to Flint of the users and other settings. Now you're asking me what the problem is right, well here goes, when I compile and run the software in Netbeans it runs just fine, however when I build the program and run it outside of netbeans it sticks at "connecting to server" heres the dilly
<code>
public Connection getConnection() {
try {
if (dbConnection == null || dbConnection.isClosed()) {
//Register the JDBC driver for MySQL.
Class.forName("com.mysql.jdbc.Driver");
url = "jdbc:mysql://server/membersinfo";
userName = "GRuser01";
password = "user01";
Connection con = DriverManager.getConnection(url, userName, password);
//statusTextArea.setText("Connection: " + con);
System.out.println("URL: " + url + "\nConnection: " + con);
dbConnection = con;
return con;
} else return dbConnection;
}catch( Exception exc ) {
exc.printStackTrace();
WarningMessage warning = new WarningMessage(true, "Error: " + CLASS_NAME + " " + exc.getMessage(), WarningMessage.CRITICAL_ERROR);
warning.setVisible(true);
return null;
}//end catch
}
</code>
That is the DB connection we're using in java. When one opens the program it opens our "switchboard" form and does a Db connection query...
<code>
initComponents();
dbConnection = new DataAccessObject();
// Local method!
addActionListeners();
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setSize((int)screenSize.getWidth(), 79);
}
</code>
I triple checked the MySQL username and password info, and that is correct. so there must be something in the programming that is a wee bit off. Or i'm a moron and posted in the wrong forum and really needed to go to the MySQL forum, and if thats the case, I am EXTREMELY sorry to the mod who has to move it, if this is however in the right place, Thank you ahead of time for any help that you all can shine on the subject. Also, this code works flawlessly at our Grand Rapids office, but not at our Flint one. Thanks again.
Well, heres a good one for you, this will probably be simple and someone should kick me, whatever. At my company we have two offices, one is in Grand Rapids, one is in Flint (Michigan); anyhow, both locations now have servers, GR had the server first, and it runs MySQL 5.0-community-nt, this runs the backbone of our software. I recently got a server for our flint office and I am making a "shadow" copy of the server here, however I am using their DB (microsoft access migrated to SQL 5.0-community-nt). I made all necessary tables and views that the software calls to, and did a backup/restore from GR to Flint of the users and other settings. Now you're asking me what the problem is right, well here goes, when I compile and run the software in Netbeans it runs just fine, however when I build the program and run it outside of netbeans it sticks at "connecting to server" heres the dilly
<code>
public Connection getConnection() {
try {
if (dbConnection == null || dbConnection.isClosed()) {
//Register the JDBC driver for MySQL.
Class.forName("com.mysql.jdbc.Driver");
url = "jdbc:mysql://server/membersinfo";
userName = "GRuser01";
password = "user01";
Connection con = DriverManager.getConnection(url, userName, password);
//statusTextArea.setText("Connection: " + con);
System.out.println("URL: " + url + "\nConnection: " + con);
dbConnection = con;
return con;
} else return dbConnection;
}catch( Exception exc ) {
exc.printStackTrace();
WarningMessage warning = new WarningMessage(true, "Error: " + CLASS_NAME + " " + exc.getMessage(), WarningMessage.CRITICAL_ERROR);
warning.setVisible(true);
return null;
}//end catch
}
</code>
That is the DB connection we're using in java. When one opens the program it opens our "switchboard" form and does a Db connection query...
<code>
initComponents();
dbConnection = new DataAccessObject();
// Local method!
addActionListeners();
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
setSize((int)screenSize.getWidth(), 79);
}
</code>
I triple checked the MySQL username and password info, and that is correct. so there must be something in the programming that is a wee bit off. Or i'm a moron and posted in the wrong forum and really needed to go to the MySQL forum, and if thats the case, I am EXTREMELY sorry to the mod who has to move it, if this is however in the right place, Thank you ahead of time for any help that you all can shine on the subject. Also, this code works flawlessly at our Grand Rapids office, but not at our Flint one. Thanks again.