loading data

I am trying to run java program that loads data on a pointbase. In the program, I hava this: "com.pointbase.jdbc.jdbcUniversalDriver" twice. I got this error twice:"java.lang.classNotFoundException:com.pointbase.jdbc.jdbcUniversalDriver. what do you think the problem is?
[278 byte] By [shakmoha] at [2007-10-2 4:47:13]
# 1

That class is not on your classpath.

[url=http://wiki.java.net/bin/view/Javapedia/ClassPath]Javapedia: Classpath[/url]

[url=http://java.sun.com/j2se/1.4.2/docs/tooldocs/windows/classpath.html]Setting the class path[/url] (Windows)

[url=http://java.sun.com/j2se/1.4.2/docs/tooldocs/findingclasses.html]How Classes are Found[/url]

java -cp .;<any other directories or jars> YourClassName

You get a NoClassDefFoundError message because the JVM (Java Virtual Machine) can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

javac -classpath .;<any additional jar files or directories> YourClassName.java

You get a "cannot resolve symbol" message because the compiler can't find your class. The way to remedy this is to ensure that your class is included in the classpath. The example assumes that you are in the same directory as the class you're trying to run.

vanilla_loraxa at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 2
I used the java -cp . classname, but i still had the error. i did not think it was about that. I thought it was more about the driver, jdbc, universal managers problem.
shakmoha at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 3
Nope. If you get a ClassNotFoundException then you have a classpath problem. Don't look anywhere else.Now, that driver comes in a jar file, doesn't it? Did you include the jar file in your classpath when you tried to run the program?
DrClapa at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 4

> I used the java -cp . classname, but i still had the

> error. i did not think it was about that. I thought

Just "java -cp . classname" is not enough. You must include the JDBC driver in the classpath. With the statement above you are only putting the current directory in the classpath.

And yes, ClassNotFoundException is ALWAYS a classpath problem.

jesperdja at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 5

I thank you for that. but, I am little bit confused about the classpath thing, jdbc, and jar file.For example, everytime I run a program, do I have to set the classpath specific for that program, like the jar file you mentioned? or I set the classpath one time? in this case, could you exactly tell me how to set the classpath for jdbc, jar file? also, if I have to set the classpath onetime, could you tell how?

shakmoha at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 6

> I thank you for that. but, I am little bit confused

> about the classpath thing, jdbc, and jar file.For

> example, everytime I run a program, do I have to set

> the classpath specific for that program, like the jar

> file you mentioned? or I set the classpath one time?

You can set the CLASSPATH environment variable to make it permanent, but that's not a good idea for a couple of reasons:

* Not all runtime environments even look at that. IDEs and app servers don't use it, or don't use it the way you might expect.

* Not all your java apps will need the same classpath.

So it's better to provide it each time on the command line. You can use batch files or shell scripts to save you some typing though.

> in this case, could you exactly tell me how to set

> the classpath for jdbc, jar file?

So you didn't really read reply 1 carefully, or the links it contains.

vanilla_loraxa at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 7
>just "java -cp . classname" is not enough. You must> include the JDBC driver in the classpath. With the> statement above you are only putting the current> directory in the classpath.How?
shakmoha at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 8

> >just "java -cp . classname" is not enough. You must

> > include the JDBC driver in the classpath. With the

> > statement above you are only putting the current

> > directory in the classpath.

>

> How?

So you didn't really read reply 1 carefully, or the links it contains.

vanilla_loraxa at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 9

> > >just "java -cp . classname" is not enough. You

> must

> > > include the JDBC driver in the classpath. With

> the

> > > statement above you are only putting the current

> > > directory in the classpath.

well, this time I put the second statement, and I am still having the error.

java -cp . classname; C:\sun\appserver\pointbase\lib\pbclient

or

c:\ set CLASSPATH= classname;pbclient, then run the classfile on the current directory where the classfile is.

shakmoha at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 10
So you didn't really read reply 1 carefully, or the links it contains.
vanilla_loraxa at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...
# 11
WAR?
shakmoha at 2007-7-16 0:52:00 > top of Java-index,Java Essentials,Java Programming...