Java variable for db not found

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jerry

    Java variable for db not found

    My configuration is as follows.
    I have a Linux MySQL server database on one box and
    I want to connect to it from a local Windows XP laptop.
    My application was developed using SunOneStudio.
    I have registered the DSN and tested the database connection via ODBC
    in Windows XP.
    It apparently connects from XP to the server.


    I have compiled two base classes and have a tester class which
    compiles except for the following compiler error:


    PathTesterOne.j ava [19:1] cannot resolve symbol
    symbol : variable patholog
    location: class PathTesterOne
    Connection c = patholog.initia lize();

    "patholog" is the Database Name on the Linux MYSQL server.
    the initialize method looks like this....


    // establish the database connection
    public static void initialize()
    {
    aMenu = new MainMenu();
    try
    { // load the jdbc - odbc bridge driver for Windows
    Class.forName(" com.mysql.jdbc. Driver");

    // create connection instance
    aConnection = DriverManager.g etConnection(ur l, "username",
    "password") ;
    // create statement object instance for this connection
    aStatement = aConnection.cre ateStatement();
    }
    catch (ClassNotFoundE xception e)
    {System.out.pri ntln(e);}
    catch (SQLException e)
    { System.out.prin tln(e); }
    }

    // The Data Source name is "patholog"
    static String url = ("jdbc:mysql ://192.168.1.101/test?user=jeral d&password=wein 3150");
    static Connection aConnection;
    static Statement aStatement;

    Why am I not able to connect to the database?

    I am not understanding what the source of the error may be.

    Thanks for any help
  • John Bell

    #2
    Re: Java variable for db not found

    Hi

    This is not a SQL Server question! I would check out any documentation for
    the JDBC driver and hopefully there will be an example similar to your
    configuration.

    John

    "Jerry" <weinstei@nova. edu> wrote in message
    news:69fca47c.0 308261630.5f62e b80@posting.goo gle.com...[color=blue]
    > My configuration is as follows.
    > I have a Linux MySQL server database on one box and
    > I want to connect to it from a local Windows XP laptop.
    > My application was developed using SunOneStudio.
    > I have registered the DSN and tested the database connection via ODBC
    > in Windows XP.
    > It apparently connects from XP to the server.
    >
    >
    > I have compiled two base classes and have a tester class which
    > compiles except for the following compiler error:
    >
    >
    > PathTesterOne.j ava [19:1] cannot resolve symbol
    > symbol : variable patholog
    > location: class PathTesterOne
    > Connection c = patholog.initia lize();
    >
    > "patholog" is the Database Name on the Linux MYSQL server.
    > the initialize method looks like this....
    >
    >
    > // establish the database connection
    > public static void initialize()
    > {
    > aMenu = new MainMenu();
    > try
    > { // load the jdbc - odbc bridge driver for Windows
    > Class.forName(" com.mysql.jdbc. Driver");
    >
    > // create connection instance
    > aConnection = DriverManager.g etConnection(ur l, "username",
    > "password") ;
    > // create statement object instance for this connection
    > aStatement = aConnection.cre ateStatement();
    > }
    > catch (ClassNotFoundE xception e)
    > {System.out.pri ntln(e);}
    > catch (SQLException e)
    > { System.out.prin tln(e); }
    > }
    >
    > // The Data Source name is "patholog"
    > static String url =[/color]
    ("jdbc:mysql ://192.168.1.101/test?user=jeral d&password=wein 3150");[color=blue]
    > static Connection aConnection;
    > static Statement aStatement;
    >
    > Why am I not able to connect to the database?
    >
    > I am not understanding what the source of the error may be.
    >
    > Thanks for any help[/color]


    Comment

    Working...