Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

How do I get SybaseDriver to query DB from JSP page?...

2 posts in General Discussion Last posting was on 2002-09-27 23:48:00.0Z
BenS1901 Posted on 2002-09-27 05:16:12.0Z
From: Bens1901
Date: Fri, 27 Sep 2002 01:16:12 -0400
Newsgroups: ianywhere.public.general
Subject: How do I get SybaseDriver to query DB from JSP page?...
Message-ID: <AD0DD0696C185DDF001CF32685256C41.001CF33685256C41@webforums>
Lines: 46
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:581
Article PK: 2401

I am trying to use Tomcat as a web server and use Jconnect to connect to a
Sybase database. When I try a JSP page with some code to go to the database
I get an error about finding the sybase jdbc class.

I created a very basic java class that is able to query the database when
it is called from the command prompt with java.exe . It connects to the
database and shows results just fine.

I installed Tomcat 4.1 and the ?index.jsp? page properly loads.

So the JSP pages execute properly, and java classes are able to connect to
the database when they are run (from the command line). However, when I
take the java code and put it into a basic JSP page, I get the following
error:
java.lang.ClassNotFoundException: com.sybase.jdbc2.jdbc.SybDriver

Here is some info about my system...
The operating system is Windows 2000.
The environment variables are as follows:
[ for the database program ]
ASANYSH8 = C:\Program Files\Sybase\Shared
ASANY8 = C:\Program Files\Sybase\SQL Anywhere 8

[ for the tomcat program ]
CATALINA_HOME = C:\Program Files\Apache Group\Tomcat 4.1

[ for java ]
JAVA_HOME = C:\jdk1.3.1_04\

CLASSPATH = C:;%JAVA_HOME%\bin;C:\Program
Files\Sybase\Shared\jconnect-5_5\classes\jconn2.jar;.;C:\Program
Files\Apache Group\Tomcat 4.1\webapps\ROOT

Path =
C:\jdk1.3.1_04\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;
C:\Program Files\Sybase\SQL Anywhere 8\win32;C:\Program
Files\Sybase\Shared\win32;C:\Program Files\Sybase\SQL Anywhere
8\drivers;C:\Program Files\Sybase\Shared\Sybase Central 4.1;C:\Program
Files\Sybase\Shared\jConnect-5_5\classes\jconn2.jar;


Any suggestions on how I can get the JSP pages to access the database with
the java code would be greatly appreciated.

Thanks in advance.

-Ben


BenS1901 Posted on 2002-09-27 23:48:00.0Z
From: Bens1901
Date: Fri, 27 Sep 2002 19:48:00 -0400
Newsgroups: ianywhere.public.general
Subject: Re: How do I get SybaseDriver to query DB from JSP page?...
Message-ID: <8644C583755CA17C0082BCE585256C41.0020582985256C41@webforums>
References: <AD0DD0696C185DDF001CF32685256C41.001CF33685256C41@webforums>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!forums.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:580
Article PK: 2400

The solution has been found by someone on another board at this site. I
needed to put the sybase driver class in the "Tomcat 4.1\common\lib"
directory.

Thanks.