[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Setting the right CLASSPATH...



Hey, I am having problems setting the CLASSPATH to the mm.mysql driver on my
Cobalt. I think that the problem is that it can't be found in the classpath.
And I know how to set the classpath, but I am not sure if I am setting the
right one a bit more on that in just a sec....here is some background info:

I am trying to connect to a MySQL database using a Java Servlet, using the
GNU java-MySQL driver mm.mysql. Really basic really.

Well, I get a error saying "SQLException: No suitable driver SQLState: 08001
".

The cause of this is (I am 99% sure, no make that 99.99999% sure) is because
the classpath is not set to include the driver properly.

I know how to set the classpath in sh, just 'export CLASSPATH =
$CLASSPATH:/path/to/driver'

Then you just 'echo $CLASSPATH' and you get the classpath, including the
part that you just added.

The problem is that if you do the above logged in as say, root, then you log
in as say user X or Y, then you can 'echo $CLASSPATH' all day long, and not
get the part that you added.

So basically, it is just setting the classpath for the user that you are
when you set it I think.

Now, on top of that, every time that say you log out, you loose the
classpath part that you added.

To keep it, I understand that you need to add it to the .profile or .login
file....but I can't find that file.

I have looked at 100-200 or so .profiles, and none of them have the
classpath in them, they just have other stuff...so I don't think that I am
looking in the right place.

But anyway, I just need to fine the right place to put the classpath so that
the java VM or Tomcat or whatever can find it, when you run a JSP or
servlet.

Well, if anyone can offer any ideas, or where to find more information, feel
free. If I am just totally missing something, tell me.

Thanks for any suggestions.
-Zach