Solved

Error with Java/Cache JDBC Classpath

Posted on 2016-11-04
2
20 Views
Last Modified: 2016-11-04
I have a developer needing to connect from Tomcat to a Cache database running on a Linux server.
I got the cachejdbc.jar and cachedb.jar files from Ontario by installing a Windows version of Cache on my local machine.
I've placed them into a folder that's located inside the classpath.  When he runs his code, it's coming back with:
java.lang.ClassNotFoundException: com.intersys.jdbc.CacheDriver

I verified that the CacheDriver.class is inside the .jar file.  I don't know what else might be the problem.
Here is the snippet of code he's using:
Class.forName ("com.intersys.jdbc.CacheDriver").newInstance();
String  url="jdbc:Cache://<OUR URL>:1972/<OUR NAMESPACE>";
java.sql.Driver drv = java.sql.DriverManager.getDriver(url);

java.util.Properties props = new Properties();
props.put("user",username);
props.put("password",password);
java.sql.Connection dbconnection = drv.connect(url, props);
0
Comment
Question by:Brian Sandt
2 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
ID: 41874800
Class.forName ("com.intersys.jdbc.CacheDriver").newInstance();

Open in new window

before that, please place the following and post what it prints

System.out.println(System.getProperty("java.class.path"));

Open in new window

0
 

Author Closing Comment

by:Brian Sandt
ID: 41874805
They decided to go through another path.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now