Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    2

    Question Unanswered: 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 18:40.

  2. #2
    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


    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •