Re: SQL Server and Tomcat
From: Yuval (yuval_at_zukermans.com)
Date: 08/04/04
- Previous message: Carb Simien [MSFT]: "RE: Alter Table Add field via JDBC, preparedStatement and Parameter fa"
- Next in thread: Paul C: "Re: SQL Server and Tomcat"
- Reply: Paul C: "Re: SQL Server and Tomcat"
- Messages sorted by: [ date ] [ thread ]
Date: 4 Aug 2004 13:14:01 -0700
"Paul C" <news@_spammer_cookson.demon.co.uk> wrote in message news:<ce5fl4$edt$1$8300dec7@news.demon.co.uk>...
> Here is the situation.
>
> I can connect to a remote SQL Server using the JDBC driver through my java
> IDE and using a Java Application.
>
> Using exactly the same class installed in Tomcat I get a "Error establishing
> socket" error. This is both using a connection pool and creating a
> Connection object, the same error occurs in a jsp and a Servlet.
>
> The servlet works fine in the Java Application in the IDE. Is there another
> configuration in Tomcat that I have to enable to let it connect to SQL
> Server.
>
> Any ideas as to why my Java IDE can connect but Tomcat cannot.
>
> All the classes are in the right places, the connection pools have been
> configured correctly and SQL Server is listening on correct ports as my Java
> App proves.
>
> Any help would be greatly appreciated.
>
> regards Paul
Paul,
The first step will be to copy the Microsoft SQL Server JDBC drivers
to the TOMCAT_HOME/common/lib folder (the files are msutil.jar,
msbase.jar and mssqlserver.jar).
This should get you going with creating a Connection object using a
DriverManager. What you should also consider is using a DataSource
object instead of creating a Connection object every time.
Look at http://www.enavigo.com/sqlserver/datasource.html - a page I
created detailing how to create the DataSource, as well as on how to
easily develop and deploy applications on Tomcat using Ant.
Hope this helps,
Yuval
- Previous message: Carb Simien [MSFT]: "RE: Alter Table Add field via JDBC, preparedStatement and Parameter fa"
- Next in thread: Paul C: "Re: SQL Server and Tomcat"
- Reply: Paul C: "Re: SQL Server and Tomcat"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|