You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Victor Gonzalez <vg...@cyberworks.com.mx> on 2003/04/03 08:23:59 UTC

jtds and connection examples.

Hi all,
 I'm really very newbie, I saw (in the list) many descriptions about the
database in the web.xml, and similar comments, well, I need to know, how
can I make it, ok, more specific, I have a tomcat and I want connect
with SQL Server, well, I download the jtds 0.5.1 and put it in the
c:\tomcat4.1.18\common\lib and put the jar in the classpath.... I think
I'm ok, I check the documentation (???) and it isn't exist! Well, I want
(please, and I will be very thankful with you) a concise explication
how-to create a connection a my database (SQL Server, of course), create
"database" in the web.xml and how I can recovery (with jtds, of course)
from database with combinations with other requirements.... Well and
syntax form...

1.  Example and explication of web.xml with sql server database
declarations.
2.  Example and explication of file.class (or more simple, into a jsp
file) to realize the connection with jtds.

3. The recovery, well, I think check it in the javadoc, Really is more
important the two first points (it is necessary like a base)

Tnks, so much!!

Regards,

Victor Gonzalez
***************


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


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

Posted by ba...@go.com.
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


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

Posted by Kwok Peng Tuck <pe...@makmal.net>.
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: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


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


org/apache/jk/common/ChannelSocket.processConnection INFO: connection timeout rached.

Posted by Victor Gonzalez <vg...@cyberworks.com.mx>.
Hi guys,
  Well, I will go to here point (alone, culeros!) but, I don't know
which parameter respect the timeout is necessary modify, if anyone is
very gentle to tell me, I will be very thankful, and I promise a cool
bear.

Regards,

I have...

W2k
Tomcat 4.1.18
IIS 5.0
SQL Server
Tomcat - SQL Server with jtds0.5.1
Tomcat - IIS with isapi_redirect.dll


Victor Gonzalez
***************
PD. The info message is only the message subject.


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


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

Posted by Victor Gonzalez <vg...@cyberworks.com.mx>.
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


Anyone used jtds??

Posted by Victor Gonzalez <vg...@cyberworks.com.mx>.
Hi all,

I need a example to use a jtds, the explanation for me (I'm very
newbie!), the files confifuration, jsp and a class, well, If is is
possible.....

Regards,

Victor González
***************


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


RE: jtds and connection examples.

Posted by Victor Gonzalez <vg...@cyberworks.com.mx>.
The jtds is for connection between Tomcat and SQL Server, and tnks by
the link, well, I hope now a sample of connection and recovery
information of it (jtds).

:)

-----Original Message-----
From: Kwok Peng Tuck [mailto:pengtuck@makmal.net]
Sent: Thursday, April 03, 2003 12:53 AM
To: Tomcat Users List
Subject: Re: jtds and connection examples.

Fortunately there is documentation  for what you want and it is in the
link listed below.

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples
-howto.html

Included are sample configurations and a small class example.

What's jtds by the way ?

Hope it helps you out.


Victor Gonzalez wrote:

>Hi all,
> I'm really very newbie, I saw (in the list) many descriptions about
the
>database in the web.xml, and similar comments, well, I need to know,
how
>can I make it, ok, more specific, I have a tomcat and I want connect
>with SQL Server, well, I download the jtds 0.5.1 and put it in the
>c:\tomcat4.1.18\common\lib and put the jar in the classpath.... I think
>I'm ok, I check the documentation (???) and it isn't exist! Well, I
want
>(please, and I will be very thankful with you) a concise explication
>how-to create a connection a my database (SQL Server, of course),
create
>"database" in the web.xml and how I can recovery (with jtds, of course)
>from database with combinations with other requirements.... Well and
>syntax form...
>
>1.  Example and explication of web.xml with sql server database
>declarations.
>2.  Example and explication of file.class (or more simple, into a jsp
>file) to realize the connection with jtds.
>
>3. The recovery, well, I think check it in the javadoc, Really is more
>important the two first points (it is necessary like a base)
>
>Tnks, so much!!
>
>Regards,
>
>Victor Gonzalez
>***************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>
>


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


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


Re: jtds and connection examples.

Posted by Kwok Peng Tuck <pe...@makmal.net>.
Fortunately there is documentation  for what you want and it is in the 
link listed below.

http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

Included are sample configurations and a small class example.

What's jtds by the way ?

Hope it helps you out.


Victor Gonzalez wrote:

>Hi all,
> I'm really very newbie, I saw (in the list) many descriptions about the
>database in the web.xml, and similar comments, well, I need to know, how
>can I make it, ok, more specific, I have a tomcat and I want connect
>with SQL Server, well, I download the jtds 0.5.1 and put it in the
>c:\tomcat4.1.18\common\lib and put the jar in the classpath.... I think
>I'm ok, I check the documentation (???) and it isn't exist! Well, I want
>(please, and I will be very thankful with you) a concise explication
>how-to create a connection a my database (SQL Server, of course), create
>"database" in the web.xml and how I can recovery (with jtds, of course)
>from database with combinations with other requirements.... Well and
>syntax form...
>
>1.  Example and explication of web.xml with sql server database
>declarations.
>2.  Example and explication of file.class (or more simple, into a jsp
>file) to realize the connection with jtds.
>
>3. The recovery, well, I think check it in the javadoc, Really is more
>important the two first points (it is necessary like a base)
>
>Tnks, so much!!
>
>Regards,
>
>Victor Gonzalez
>***************
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
>
>  
>


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