tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Allistair Crossley" <Allistair.Cross...@QAS.com>
Subject RE: JTDS help
Date Mon, 07 Feb 2005 17:37:13 GMT
Hi,

There's no real reason relating to Tomcat or jTDS that this would run slow. You are more likely
to find answers with your hardware, network latency, database load or row size and other environmental
factors.

Allistair.

> -----Original Message-----
> From: Charles P. Killmer [mailto:charlesk@netgaintechnology.com]
> Sent: 07 February 2005 17:34
> To: Tomcat Users List
> Subject: JTDS help
> 
> 
> I am trying to get Tomcat talking to my database quickly.  This code
> takes about 2-3 seconds to load.  Anyone got any idea's why?  
> Or if you
> run this in your environment, how well does it run?
>  
> <%@ page language="java" import="java.sql.*"%>
> <%
> Connection conn =
> DriverManager.getConnection("jdbc:jtds:sqlserver://*.*.*.*:143
> 3/dbname;u
> ser=******;password=*******");
>  
> Statement stmt = conn.createStatement(ResultSet.TYPE_FORWARD_ONLY,
> ResultSet.CONCUR_READ_ONLY);
> ResultSet rs;
>  
> rs = stmt.executeQuery("SELECT * FROM accounts");
>  
> out.println("<table>");
> String name;
> String ID;
> while (rs.next()) {
>    name = rs.getString("Name");
>    ID = rs.getString("ID");
>    out.println("<tr><td>" + ID + "</td><td>"+name+"</td></tr>"
);
> }
>  
> out.println( "</table>" );
>  
> conn.close();
> %>
>  
> This is just a JSP script, nothing is compiled.  I know it is 
> better to
> compile, but I am trying to chase down this DB slowness first.
>  
> Charles Killmer
> Netgain Technology
> CharlesK@NetgainTechnology.com
> Office: (320) 251-4700 ext 107
>  
> 


<FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE> 
-------------------------------------------------------
QAS Ltd.
Developers of QuickAddress Software
<a href="http://www.qas.com">www.qas.com</a>
Registered in England: No 2582055
Registered in Australia: No 082 851 474
-------------------------------------------------------
</FONT>


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


Mime
View raw message