Setting CLASSPATH so it can find my Sybdriver.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Derek_Illchuk
Posted On:   Thursday, January 17, 2002 10:15 AM

I have a program which has this line: Driver driver = (Driver)Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance(); I am running this on Linux. Now, I can get this line to work when I type: export CLASSPATH=$CLASSPATH:/opt/jConnect-5_5/classes/jconn2.jar into the same terminal window I use to run the java command. The problem arises, though, when I use this class as a javaBean. It doesn't have access to that CLASSPATH, I guess, and so doesn't work. My question then: How would I make the CLASSPATH "global", so to speak? Thanks, Derek    More>>

I have a program which has this line:

Driver driver = (Driver)Class.forName("com.sybase.jdbc2.jdbc.SybDriver").newInstance();

I am running this on Linux. Now, I can get this line to work when I type:

export CLASSPATH=$CLASSPATH:/opt/jConnect-5_5/classes/jconn2.jar

into the same terminal window I use to run the java command. The problem arises, though, when I use this class as a javaBean. It doesn't have access to that CLASSPATH, I guess, and so doesn't work.

My question then:

How would I make the CLASSPATH "global", so to speak?

Thanks, Derek

   <<Less

Re: Setting CLASSPATH so it can find my Sybdriver.

Posted By:   Bozidar_Dangubic  
Posted On:   Thursday, January 17, 2002 10:49 AM

i do not understand your question. CLASSPATH is global. there is only one CLASSPATH variable on the environment. when you run java from the command line, it looks in CLASSPATH for resources. when you run the class as the java bean, the application you are running needs jconn2.jar in the classpath in order to run. in the startup script you can append jconn2.jar to the CLASSPATH or you can add it in the application that you are using the JavaBean from.
About | Sitemap | Contact