473,441 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,441 software developers and data experts.

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.java [19:1] cannot resolve symbol
symbol : variable patholog
location: class PathTesterOne
Connection c = patholog.initialize();

"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.getConnection(url, "username",
"password");
// create statement object instance for this connection
aStatement = aConnection.createStatement();
}
catch (ClassNotFoundException e)
{System.out.println(e);}
catch (SQLException e)
{ System.out.println(e); }
}

// The Data Source name is "patholog"
static String url = ("jdbc:mysql://192.168.1.101/test?user=jerald&password=wein3150");
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
Jul 20 '05 #1
1 2239
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" <we******@nova.edu> wrote in message
news:69**************************@posting.google.c om...
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.java [19:1] cannot resolve symbol
symbol : variable patholog
location: class PathTesterOne
Connection c = patholog.initialize();

"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.getConnection(url, "username",
"password");
// create statement object instance for this connection
aStatement = aConnection.createStatement();
}
catch (ClassNotFoundException e)
{System.out.println(e);}
catch (SQLException e)
{ System.out.println(e); }
}

// The Data Source name is "patholog"
static String url = ("jdbc:mysql://192.168.1.101/test?user=jerald&password=wein3150"); 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

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Johan Louwers | last post by:
I have a qustion. I have to set a JAVA_HOME variable on a Solaris9 system... what kind of a variable? A system-defined.../....a user defined.../.....???? and how do I set this so java can...
4
by: Laura P | last post by:
Hi, I wasn't sure whether this should be posted in the Java are or in a Solaris thread, so I shall post it in both. Sorry for the duplication. I am new to Solaris and am having trouble...
73
by: RobertMaas | last post by:
After many years of using LISP, I'm taking a class in Java and finding the two roughly comparable in some ways and very different in other ways. Each has a decent size library of useful utilities...
2
by: Matt | last post by:
I'm new to Java but experienced with PL/SQL. I've found what appears to be strange behaviour (a bug?) when attempting to create java stored objects using the UNIX version of Oracle SQL*PLUS...
4
by: Rhino | last post by:
I've been playing with Java UDFs for the last couple of days and I've got some questions about scratchpads. I'm running DB2 LUW V8 (FP8) on WinXP. Somewhere in the manuals, I found some remarks...
1
by: Markus Wollny | last post by:
Hi! I am trying to build PostgreSQL 7.4.3 with Java enabled; I've got Apache Ant version 1.5 and j2sdk1.4.1_05 installed: Verifiying ant: # which javac /usr/java/j2sdk1.4.1_05/bin/javac #...
36
by: Robert Baer | last post by:
I used Google and found some references for integer in Java. But "int" not only does not work, it also prevents reading X and Y coordinates of the mouse. What i would like to do: 1) Get X and Y...
6
by: =?Utf-8?B?VkIgSm9ubmll?= | last post by:
ASP.NET 2.0 / Visual Studio 2005 / VB.Net 2.0 I have a web interface that needs to launch a java application. What a long strange trip it has been... I am using Process.Start process start...
1
by: aapexclient | last post by:
I have a problem with Java finding my custom class directory. I have searched the forums and tried everything, but nothing seems to work. The <javapgm>.java compiled cleanly and created...
5
by: r035198x | last post by:
Setting up. Getting started To get started with java, one must download and install a version of Sun's JDK (Java Development Kit). The newest release at the time of writting this article is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.