sarah khan

Greenhorn
+ Follow
since Apr 09, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sarah khan

what's mysql 's driver name is it for example


mysql-connector-java-3.1.7-bin.jar

I am trying to connect to mysql and I have the above mentioned driver installed and am trying to connect to it I get no exceptions in registering it!!! but getting null exceptions when try to connect to it??? I tried the
System.out.println(DriverManager.getDrivers());

and it printed
java.util.Vector$1@b753f8

some sort of address (does not tell me a whole lot???)

here's the exact code I have to connect:

try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
String tURLString = "jdbc:mysql://localhost/empdb?user=root&password=admin";
boolean tStillTrying = true;
int tNumberOfTries = 0;
while (tStillTrying) {
try {
System.out.println(DriverManager.getDrivers());
iConnection = DriverManager.getConnection(tURLString, "", "");
tStillTrying = false;
}
catch (Exception rException) {
tNumberOfTries++;
tStillTrying = (tNumberOfTries > 20);
}
}
if ( iConnection == null )
System.out.println("iConnection is null");
else
System.out.println("got connected to the database");
Hi everyone! I am new to distributed java and am trying to learn... Trying to run the example on http://java.sun.com/j2se/1.5.0/docs/guide/idl/GShome.html

according to the instructions given (I copied the code)but it does not work... does anyone know what to expect after I start the helloserver ? And I get 'NoClassDefFoundError:' when I run the client....
Does anyone know what's wrong and how to fix it?
19 years ago