JDBC-ConnectionTimeout

2004-06-22 Thread Frank von Daak
Hi...

...is there really noone, who can tell me, how to set up the 
connection-timeout for a mssql-based ConnectionPool with tomcat ?

The methode getLoginTimeout() and setLoginTimeout() does not seem to be 
avaible. If I try to use them, I get this error:

UnsupportedOperationException

--
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup(ctx_lookup);
DataSource ds   = (DataSource)envContext.lookup(env_lookup);

out.println(ds.getLoginTimeout());
--

Thank you very much !

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does.

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



JDBC-ConnectionTimeout

2004-06-22 Thread Frank von Daak
Hi...

...is there really noone, who can tell me, how to set up the 
connection-timeout for a mssql-based ConnectionPool with tomcat ?

The methode getLoginTimeout() and setLoginTimeout() does not seem to be 
avaible. If I try to use them, I get this error:

UnsupportedOperationException

--
Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup(ctx_lookup);
DataSource ds   = (DataSource)envContext.lookup(env_lookup);

out.println(ds.getLoginTimeout());
--

Thank you very much !
-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does.

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



ConnectionPool timeout

2004-06-21 Thread Frank von Daak
Hello !

I've installed tomcat4 and I'm using the MSSQL-JDBC-Driver with tomcats 
connectionpooling.

Now I have a question about timeouts.

In my JSP-site I get a connection from the pool, which works great.
But if the Database-Server is not reachable, the JSP does not give any 
feedback - it will wait for a connection for a very, very long time. After 
about 10-15 minutes, I get the following message:
[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.



Here's a test-jsp, which shows, where the script hangs:
--
%@ page language=java 
import=java.util.*,java.sql.*,javax.sql.*,javax.naming.* %
%
Connection db_con   = null;

Context initContext = new InitialContext();
Context envContext  = (Context)initContext.lookup(java:/comp/env);
DataSource ds   = (DataSource)envContext.lookup(jdbc/test_db);

if ( ds != null ) {
try {
// This is the place, where the script hangs, when the  
// database-server is not avaible
db_con = ds.getConnection();
} catch ( SQLException se ) {
System.out.println(Exception while connecting to db! ( +  
se.getMessage() + ));
} finally {
try { db_con.close(); } catch ( SQLException se ) {};
}
}
%
--

Who can tell me, how to configure the timeout ?
I think, that 10-15 minutes is much to long :-(
(You will find the ressource-conf for my pool at the end of this mail)


Thank you very much for your help !


Greetings
Frank

--
Ressource-Conf in my server.xml
--


Resource name=jdbc/test_db type=javax.sql.DataSource/
ResourceParams name=jdbc/test_db
parameter
namedriverClassName/name

valuecom.microsoft.jdbc.sqlserver.SQLServerDriver/value
/parameter
parameter
nameurl/name
valuejdbc:microsoft:sqlserver://192.168.0.199:1433;databasename=test_db/value
/parameter
parameter
nameusername/name
valuetester/value
/parameter
parameter
namepassword/name
valuetest/value
/parameter
parameter
namevalidationQuery/name
valueselect count(*) from users/value
/parameter
parameter
namemaxWait/name
value5000/value
/parameter
parameter
namemaxActive/name
value40/value
/parameter
parameter
namemaxIdle/name
value2/value
/parameter
/ResourceParams

--
web.xml
--
web-app
  descriptionTest-DB/description
  resource-ref
  descriptionDB Connection/description
  res-ref-namejdbc/test_db/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
  /resource-ref
/web-app

--

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does.

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



Re: ConnectionPool timeout

2004-06-21 Thread Frank von Daak
Hi again.

What the hell ist this ?
Spam as autorespond on the tomcat-user list 

Oh f... 
unbelevable!!!


Am Montag, 21. Juni 2004 20:43 schrieb Autoresponder:
 Most likely the answer to your question is at:



 http://pc-magic.com/faq.htm



 Should you not find the answer to your question you will

 be told how to contact us directly.



 Thank you.



 (This is an automated response)

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does.

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



Re: Tomcat and MsSQL - Resolved

2003-08-31 Thread Frank von Daak
Hi,

after a very long search, I've found the solution for my problem.

I've installed tomcat4 directly from debian (.deb)
This installation has activatet the security-manager per default - and this 
caused the problem.

I've had to grant access to the IP and Port of the SQL-Server in the security 
manager.
After this I was able to open a Socket, but the driver still doesn't work, 
becaus of missing file permissions ([Microsoft][SQLServer 2000 Driver 
for JDBC]Error opening/loading com.microsoft.util.transliteration.properties.)

I've decided to deactivate the security manager - and now, everything is 
working well !

Greetings,
Frank


Am Samstag, 30. August 2003 12:33 schrieb Christopher Williams:
 Question: Are you certain that SQL Server is listening on port 1433? I've
 seen it using port 1141.  Use the SQL Server network utility to check the
 TCP port.

 - Original Message -
 From: Frank von Daak [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, August 30, 2003 10:51 AM
 Subject: Tomcat and MsSQL

  Hi,
 
 
  maybe, someone of you can help me...
 
  I try to port a webapplication from asp to java...
 
  First, I have used Websphere for this and everything worked ok, but then
  I decided to use tomcat4 (both under debian-linux)
 
  My problem is the connection to a MSSQL-Database.
 
  As JDBC-Driver I'm using the  Microsoft SQL Server 2000 Driver for
  JDBC, which has an official linux-support. And I cn say, that it is
  working very well with websphere...
 
  When I use the same jsp-files under tomcat, I get the following error,

 when

  trying to connect the sql-server:
 
  [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
 
 
  I have copied the 3 files msbase.jar, mssqlserver.jar and
  msutil.jar

 to

  $CATALINA_HOME/common/lib and it seems, that tomcat can find them (as the
  error message says)
 
  Here is the code, that I use to connect to the database:
 
  --
 
  %@ page language=java import=javax.sql.DataSource,java.sql.*%
  %
 
  Connection db_con;
  Statement db;
 
  try {
Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver);
  } catch (ClassNotFoundException e) {
out.println(h1Der Datenbanktreiber konnte nicht gefunden werden: +
  e

 +

  e.getMessage() + /h1 );
  }
 
  String con = jdbc:microsoft:sqlserver://192.168.0.199:1433;User=sa;
  Password=bla;DatabaseName=testdb;
 
  try {
db_con = DriverManager.getConnection (con);
  } catch ( SQLException se ) {
out.println(Exception...( + se.getMessage() + )br--);
  }
  %
 
  --
 
 
  What do I have to do, to get it working with tomcat ?
 
 
  Thank you very much for your help !!!
 
  Greetings,
  Frank
 
  --
  Name: Frank von Daak
  eMail: [EMAIL PROTECTED] Homepage: http://www.kpage.de
  eMail:  [EMAIL PROTECTED] Homepage: http://www.linux-dev.de
  If Bill Gates had a nickel for every time Windows crashed...
  - oh wait, he does.
 
  -
  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]

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
eMail:  [EMAIL PROTECTED]   Homepage: http://www.linux-dev.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does. 

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



Tomcat and MsSQL

2003-08-30 Thread Frank von Daak
Hi,

 
maybe, someone of you can help me... 
 
I try to port a webapplication from asp to java... 

First, I have used Websphere for this and everything worked ok, but then I 
decided to use tomcat4 (both under debian-linux)
 
My problem is the connection to a MSSQL-Database.
 
As JDBC-Driver I'm using the  Microsoft SQL Server 2000 Driver for JDBC, 
which has an official linux-support. And I cn say, that it is working very 
well with websphere...
 
When I use the same jsp-files under tomcat, I get the following error, when 
trying to connect the sql-server:

[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
 
 
I have copied the 3 files msbase.jar, mssqlserver.jar and msutil.jar to 
$CATALINA_HOME/common/lib and it seems, that tomcat can find them (as the 
error message says)
 
Here is the code, that I use to connect to the database:
 
--
 
%@ page language=java import=javax.sql.DataSource,java.sql.*%
%
 
Connection db_con;
Statement db;
 
try {
  Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver);
} catch (ClassNotFoundException e) {
  out.println(h1Der Datenbanktreiber konnte nicht gefunden werden: + e + 
e.getMessage() + /h1 );
}
 
String con = jdbc:microsoft:sqlserver://192.168.0.199:1433;User=sa;
Password=bla;DatabaseName=testdb;
 
try {
  db_con = DriverManager.getConnection (con);
} catch ( SQLException se ) {
  out.println(Exception...( + se.getMessage() + )br--);
}
%
 
--
 
 
What do I have to do, to get it working with tomcat ? 
 
 
Thank you very much for your help !!! 

Greetings, 
Frank

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
eMail:  [EMAIL PROTECTED]   Homepage: http://www.linux-dev.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does. 

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



Re: Tomcat and MsSQL

2003-08-30 Thread Frank von Daak
Hi,


Am Samstag, 30. August 2003 12:33 schrieb Christopher Williams:
 Question: Are you certain that SQL Server is listening on port 1433? I've
 seen it using port 1141.  Use the SQL Server network utility to check the
 TCP port.

yes, I'm sure it is, because I use the same jsp-file under websphere an it's 
working fine.
A telnet 192.168.0.10 1433 also gives a response...



 - Original Message -
 From: Frank von Daak [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Saturday, August 30, 2003 10:51 AM
 Subject: Tomcat and MsSQL

  Hi,
 
 
  maybe, someone of you can help me...
 
  I try to port a webapplication from asp to java...
 
  First, I have used Websphere for this and everything worked ok, but then
  I decided to use tomcat4 (both under debian-linux)
 
  My problem is the connection to a MSSQL-Database.
 
  As JDBC-Driver I'm using the  Microsoft SQL Server 2000 Driver for
  JDBC, which has an official linux-support. And I cn say, that it is
  working very well with websphere...
 
  When I use the same jsp-files under tomcat, I get the following error,

 when

  trying to connect the sql-server:
 
  [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
 
 
  I have copied the 3 files msbase.jar, mssqlserver.jar and
  msutil.jar

 to

  $CATALINA_HOME/common/lib and it seems, that tomcat can find them (as the
  error message says)
 
  Here is the code, that I use to connect to the database:
 
  --
 
  %@ page language=java import=javax.sql.DataSource,java.sql.*%
  %
 
  Connection db_con;
  Statement db;
 
  try {
Class.forName(com.microsoft.jdbc.sqlserver.SQLServerDriver);
  } catch (ClassNotFoundException e) {
out.println(h1Der Datenbanktreiber konnte nicht gefunden werden: +
  e

 +

  e.getMessage() + /h1 );
  }
 
  String con = jdbc:microsoft:sqlserver://192.168.0.199:1433;User=sa;
  Password=bla;DatabaseName=testdb;
 
  try {
db_con = DriverManager.getConnection (con);
  } catch ( SQLException se ) {
out.println(Exception...( + se.getMessage() + )br--);
  }
  %
 
  --
 
 
  What do I have to do, to get it working with tomcat ?
 
 
  Thank you very much for your help !!!
 
  Greetings,
  Frank
 
  --
  Name: Frank von Daak
  eMail: [EMAIL PROTECTED] Homepage: http://www.kpage.de
  eMail:  [EMAIL PROTECTED] Homepage: http://www.linux-dev.de
  If Bill Gates had a nickel for every time Windows crashed...
  - oh wait, he does.
 
  -
  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]

-- 
Name:   Frank von Daak
eMail:  [EMAIL PROTECTED]   Homepage: http://www.kpage.de
eMail:  [EMAIL PROTECTED]   Homepage: http://www.linux-dev.de
If Bill Gates had a nickel for every time Windows crashed...
- oh wait, he does. 

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