File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not sure which Linux Jar covers SqlException

 
Don Campbell
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don Campbell
Greenhorn
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.


  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic