Solved

Error with Java/Cache JDBC Classpath

Posted on 2016-11-04
2
30 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
network + 7 80
Java array passed to SQL where clause 23 62
replace a word with other 1 40
configure dependency in POM for new database 3 15
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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…
The viewer will learn how to implement Singleton Design Pattern in Java.

911 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

22 Experts available now in Live!

Get 1:1 Help Now