Check and see if the password and username is correct for the database you setup.

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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to