Solved

Error with Java/Cache JDBC Classpath

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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to get all the API from website? 11 88
servlet example 17 31
hibernate example issues from command prompt 10 41
Glassfish admin console not working 1 12
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…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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