You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ba...@go.com on 2003/04/03 23:51:46 UTC

Re: DriverManager.getConnection("jdbc:jtds:sqlserver://127.0.0.1:1443/Servi ces"..... Failured... Please, help me!

Are you providing a user name and password?
I am not familiar with this driver, but with the IBM DB2 driver a property 
of prompt=false is also needed.


At 12:40 PM 4/3/2003 -0600, Victor Gonzalez wrote:
>The message is...
>
>java.sql.SQLException: Connection refused: connect
>         at net.sourceforge.jtds.jdbc.TdsConnection.allocateTds(Unknown
>Source)
>         at net.sourceforge.jtds.jdbc.TdsConnection.<init>(Unknown
>Source)
>         at net.sourceforge.jtds.jdbc.Driver.connect(Unknown Source)
>         at java.sql.DriverManager.getConnection(DriverManager.java:512)
>         at java.sql.DriverManager.getConnection(DriverManager.java:171)
>         at foo.Arteli.init(Arteli.java:25)
>         at org.apache.jsp.Arteli_jsp._jspService(Arteli_jsp.java:52)
>         at
>org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>
>Somebody why??
>
>The files is:
>Empresa.java
>public class Empresa {
>   String foo = "Not Connected";
>   int bar = -1;
>   Connection conn;
>   public void init() {
>     try{
>       conn = null;
>       Class.forName("net.sourceforge.jtds.jdbc.Driver");
>       Connection conn =
>DriverManager.getConnection("jdbc:jtds:sqlserver://127.0.0.1:1443/Servic
>es","sa","");
>       Statement stmt = conn.createStatement();
>       ResultSet rst = stmt.executeQuery("SELECT * FROM consecutivos");
>       if(rst.next()){
>         foo=rst.getString(1);
>         bar=rst.getInt(2);
>       }
>       conn.close();
>     }
>     catch(Exception e){
>       e.printStackTrace();
>     }
>   }
>   public String getFoo() { return foo; }
>   public int getBar() { return bar;}
>}


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org