wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes Not sure which Linux Jar covers SqlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Not sure which Linux Jar covers SqlException" Watch "Not sure which Linux Jar covers SqlException" New topic
Author

Not sure which Linux Jar covers SqlException

Don Campbell
Greenhorn

Joined: Jan 18, 2013
Posts: 3
Hi,

We're able to compile and run an application in Windows, but cannot compile the same code in Linux. We are obviously missing a CLASSPATH, but I can't seem to locate the correct .jar, even after searching Google for 3 days.

Background: My Java experience is in Windows.


We've tried several different CLASSPATH combinations. Here is the most recent effort:



$ printenv CLASSPATH
/oracle/app/oracle5/product/11.2Gateway/jdbc/lib:/oracle/app/oracle5/product/11.2Gateway/jdk/jre/lib/rt.jar:/oracle/app/oracle5/product/11.2Gateway/jdbc/lib/ojdbc6.jar
...
$ javac StudentList.java
StudentList.java:12: cannot find symbol
symbol : constructor SQLException(java.lang.String,java.lang.Exception)
location: class java.sql.SQLException
throw new SQLException("Oracle JDBC is not available",e);
^
1 error
....
$



I know this is a very simple problem, but can't seem to get past it.

Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3418
    
  12
What version of Java are you using on the Linux box ? The SQLException constructor that takes String and Throwable parameters was added in Java 1.6.


Joanne
Don Campbell
Greenhorn

Joined: Jan 18, 2013
Posts: 3
Joanne Neal wrote:What version of Java are you using on the Linux box ? The SQLException constructor that takes String and Throwable parameters was added in Java 1.6.


That's a good point. It looks like 1.6 is available there, but we're using 1.5. I'll try and find out if there's any reason we can't switch to 1.6.


Don Campbell
Greenhorn

Joined: Jan 18, 2013
Posts: 3
Don Campbell wrote:
Joanne Neal wrote:What version of Java are you using on the Linux box ? The SQLException constructor that takes String and Throwable parameters was added in Java 1.6.


That's a good point. It looks like 1.6 is available there, but we're using 1.5. I'll try and find out if there's any reason we can't switch to 1.6.




That was the issue Joanne, thanks. Our prod linux environment compiles and executes the code, without a hitch. It's 1.6. Our test environment is the problem, and the reason (as you stated) was that it is still in the 1.5 world.


 
Don't get me started about those stupid light bulbs.
 
subject: Not sure which Linux Jar covers SqlException
 
Similar Threads
How to connect jdk1.7 and oracle 10g express edition in eclipse
java.sql.SQLException: No suitable driver
Oracle Java Stored Proceedures - loadjava not found
Java and ORACLE XE connectivity Problem
compiled or not compiled