Results 1 to 2 of 2
  1. #1
    javavick is offline Member
    Join Date
    May 2010
    Posts
    1
    Rep Power
    0

    Default JDBC connection to Cache - error

    Hi,

    I'm new to JDBC and trying to write a simple program to connect to Cache database. the program is pasted below.

    import java.sql.*;
    import com.intersys.jdbc.CacheDriver;
    public class test
    {
    public static void main(String args[])
    {

    System.out.println("hello world");
    }
    }
    When I compile it, it gives the following error

    test.java:1: package com.intersys.jdbc does not exist
    import com.intersys.jdbc.CacheDriver;

    I have included the CacheDB.jar file in the CLASSPATH of user variables, which is C:\InterSystems\Cache\Dev\java\lib\JDK14; but still I get this error and I'm able to compile simple programs and run , those that doesnt involve com.intersys.... packages.

    Please help if anyone knows the cause.

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    11,748
    Rep Power
    19

    Default

    You need to include the jar file, not just the directory.
    It's also not advisable to stick these things in the CLASSPATH, but to use the proper switch for javac (-cp), or to set up your project correctly in an IDE.

Similar Threads

  1. Error creating JDBC connection in Eclipse
    By tascoa in forum Eclipse
    Replies: 2
    Last Post: 11-06-2009, 10:20 AM
  2. Help me this error in JDBC-ODBC connection
    By lordelf in forum Java Servlet
    Replies: 3
    Last Post: 04-04-2009, 08:37 AM
  3. Replies: 0
    Last Post: 04-01-2008, 10:17 AM
  4. JSP - using connection cache
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-30-2008, 09:54 AM
  5. Replies: 0
    Last Post: 09-28-2007, 12:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •