If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Creating a JAVA front end to mySQL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-09-04, 17:25
Sunstarwu Sunstarwu is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
Question Creating a JAVA front end to mySQL

I would be soo greatful if somebody could help me with this problem I have been facing. I am trying to put a front end JAVA GUI to mySQL through Oracle. The code I am using works fine at UNI but at home it does not connect.

Here is the code I am using for the ConnectionManager:

private ConnectionManager(){
String username = "scoot";//replace yourusername with your Oracle ID
String password = "tiger";//replace yourpassword with your Oracle password
try {
// Load the Oracle Driver
Class.forName("oracle.jdbc.driver.OracleDriver");

try{
// Get a connection from the connection factory
con = DriverManager.getConnection("jdbcracle:thin:@ pime:1521:ssd",username, password);
}
catch (SQLException e){
System.out.println(e.getMessage());
System.out.println("Cannot connect - have you got the correct username and password?");
System.exit(0);
}
}

The SQLException I get returns this message: "Io exception: The Network Adapter could not establish the connection"

Any suggestions would be really greatful!

Thanks
Sunny

Last edited by Sunstarwu; 02-09-04 at 17:40.
Reply With Quote
  #2 (permalink)  
Old 02-09-04, 17:39
Sunstarwu Sunstarwu is offline
Registered User
 
Join Date: Feb 2004
Posts: 2
Re: Creating a JAVA front end to mySQL

Sorry people i was just me being stupid...my damm Firewall was stoping the ConnectionManager from creating a connection!

All sorted now


Quote:
Originally posted by Sunstarwu
I would be soo greatful if somebody could help me with this problem I have been facing. I am trying to put a front end JAVA GUI to mySQL through Oracle. The code I am using works fine at UNI but at home it does not connect.

Here is the code I am using for the ConnectionManager:

private ConnectionManager(){
String username = "scoot";//replace yourusername with your Oracle ID
String password = "tiger";//replace yourpassword with your Oracle password
try {
// Load the Oracle Driver
Class.forName("oracle.jdbc.driver.OracleDriver");

try{
// Get a connection from the connection factory
con = DriverManager.getConnection("jdbcracle:thin:@ pime:1521:ssd",username, password);
}
catch (SQLException e){
System.out.println(e.getMessage());
System.out.println("Cannot connect - have you got the correct username and password?");
System.exit(0);
}
}

The SQLException I get returns this message: "Io exception: The Network Adapter could not establish the connection"

Any suggestions would be really greatful!

Thanks
Sunny
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On