Re: SQL Server and Tomcat

From: Yuval (yuval_at_zukermans.com)
Date: 08/04/04

  • Next message: KC Wong: "Re: Japanese words"
    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


  • Next message: KC Wong: "Re: Japanese words"

    Relevant Pages

    • Re: SQL Server and Tomcat
      ... >> IDE and using a Java Application. ... >> Connection object, the same error occurs in a jsp and a Servlet. ... >> The servlet works fine in the Java Application in the IDE. ... >> configured correctly and SQL Server is listening on correct ports as my ...
      (microsoft.public.sqlserver.jdbcdriver)
    • SQL Server and Tomcat
      ... IDE and using a Java Application. ... This is both using a connection pool and creating a ... The servlet works fine in the Java Application in the IDE. ... configured correctly and SQL Server is listening on correct ports as my Java ...
      (microsoft.public.sqlserver.jdbcdriver)
    • Re: Java-Rauschen (war: Re: Getter & Setter)
      ... also stimmst du mir zu dass Java ohne IDE schlecht nutzbar ist? ... Nun mal abgesehen dass man APIs nicht mehr lernt, sondern sich einfach auf Codecompletion verlässt und dabei Hilfsklassen vollkommen ignoriert, ... Oder wenn der Grad des Rauschen so unterschiedlich ist? ...
      (de.comp.lang.java)
    • Re: Java-Rauschen (war: Re: Getter & Setter)
      ... welche Perspektive hatten denn die Leute, die Java entworfen haben? ... Aber gehe ich recht in der Annahme dass du dann sagst, dass Java erst durch eine IDE "richtig gut" wird?... ... Ich sehe es allerdings für eine textbasierte Programmiersprache als Nachteil an, wenn sie aufgrund der "Umständlichkeit" der Sprache ohne IDE kaum nutzbar ist. ...
      (de.comp.lang.java)
    • Java-Rauschen (war: Re: Getter & Setter)
      ... aber bei HTML ist nicht so sehr der Source als viel mehr das was im Browser angezeigt wird wichtig. ... Ich finde, eine interessantere Frage ist, warum man ueberhaupt gegen eine IDE ist. ... Nur hängt das mit einer bestimmten Menge an Code zusammen und die erreicht man bei Java schneller als bei zum Beispiel Ruby. ... Ich sehe es allerdings für eine textbasierte Programmiersprache als Nachteil an, wenn sie aufgrund der "Umständlichkeit" der Sprache ohne IDE kaum nutzbar ist. ...
      (de.comp.lang.java)

    Loading