Re: Connection between TOMCAT and DB2 ???

2002-08-01 Thread Ryszard Lach

On Wed, Jul 31, 2002 at 03:11:03PM -0400, [EMAIL PROTECTED] wrote:
 
 Thanks Richard for your help,
 
 Yes, just now I managed to connect DB2 to Tomcat and using simple java file
 able to retrieve the values from sample database.
 
 But I have a question for you.
 while defining my Connection URL I never specified a port number.
   String url = jdbc:db2://100.3.13.34/sample;
 
 If you see above I just gave IP address of my machine and not port number.
 In past cases I have used port number given to me by the DBA.
 
 I would like to know what is the importance of port number and which
 service is running on this port.
 

DB2 usually listens on 5 port (the server). You use it in 'catalog
tcpip node' command on client, then you execute 'catalog
database...as...at node ...' on the client machine and then use the new
database name and ip of the client machine. You don't need the port
number, DB2 client knows it.

Richard.

-- 
First they ignore you. Then they laugh at you. Then they
fight you. Then you win. - Mohandas Gandhi.

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




Re: Connection between TOMCAT and DB2 ???

2002-08-01 Thread Nishant_Awasthi


Richard
Correct me if I am undertanding it correctly.
If the DB2 server is running on (default port 5) cline tmachine
then in my client application, I need not specify the port number.

But I may or maynot use the port number (5) in my Connection URL
string.
Now When I use
 String url = jdbc:db2://100.3.13.34:5/sample; /** with port number ,
it doesnot work ***/

 String url = jdbc:db2://100.3.13.34/sample; /** without it works ***/

There are two things that are bugging me:

1. Why specifying portnumber doesnot work (though I understand it is not
necessary)

2. In my earlier experience, I need to specify the port number that is not
5 but some other number...Is it because it is not the default port
number
that I need to specify it in my Connection string.

Please reply me if you think I have a point...
Thanks


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   

Ryszard Lach   

[EMAIL PROTECTED]  To: Tomcat Users List 

 [EMAIL PROTECTED]  

08/01/2002   cc: (bcc: Nishant Awasthi)

04:47 AM Subject: Re: Connection between TOMCAT 
and
Please   DB2 ???   

respond to 

Tomcat Users  

List  

   

   






On Wed, Jul 31, 2002 at 03:11:03PM -0400, [EMAIL PROTECTED]
wrote:

 Thanks Richard for your help,

 Yes, just now I managed to connect DB2 to Tomcat and using simple java
file
 able to retrieve the values from sample database.

 But I have a question for you.
 while defining my Connection URL I never specified a port number.
   String url = jdbc:db2://100.3.13.34/sample;

 If you see above I just gave IP address of my machine and not port
number.
 In past cases I have used port number given to me by the DBA.

 I would like to know what is the importance of port number and which
 service is running on this port.


DB2 usually listens on 5 port (the server). You use it in 'catalog
tcpip node' command on client, then you execute 'catalog
database...as...at node ...' on the client machine and then use the new
database name and ip of the client machine. You don't need the port
number, DB2 client knows it.

Richard.

--
First they ignore you. Then they laugh at you. Then they
fight you. Then you win. - Mohandas Gandhi.

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





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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Turner, John


Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks




Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   

Turner,   

JohnTo: 'Tomcat Users List'   

JTurner@AAS.[EMAIL PROTECTED]  

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between TOMCAT 
and
07/31/2002   DB2 ???   

09:27 AM   

Please 

respond to 

Tomcat Users  

List  

   

   







Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks





Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Sullivan, Mark E

Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the 
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





 

Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List

 

 







Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks





Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





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

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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Michael Remijan

...

Here's a thought.  are the drivers for DB2 100% java native.  I'm remembering a 
problem a colleage of mind had using the the jdbc drivers for a database named 
Progress.  It turns out they were not 100% java and relied on calls to native 
libraries.  If you're running on windows it'll be a dll or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   

Turner,   

JohnTo: 'Tomcat Users List'   

JTurner@AAS.[EMAIL PROTECTED]  

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between TOMCAT 
and
07/31/2002   DB2 ???   

09:27 AM   

Please 

respond to 

Tomcat Users  

List  

   

   







Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks





Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





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




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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Sullivan, Mark E

you also have to have the 'IBM JDBC APPLET SERVER' running. 

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:14 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???


...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





 

Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List

 

 







Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks





Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





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




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

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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Sullivan, Mark E 
  
Mark.Sullivan@nav-internatTo: 'Tomcat Users List' 
  
ional.com 
[EMAIL PROTECTED]  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 09:54 AMSubject: RE: Connection 
between TOMCAT and
Please respond to Tomcat  DB2 ??? 
  
Users List
  
   
  
   
  





Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Michael Remijan

..

I'm going to bet it's because of Program Files  try putting it in a directory 
without spaces or use progra~1 in place of Program Files

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:35 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Sullivan, Mark E 
  
Mark.Sullivan@nav-internatTo: 'Tomcat Users List' 
  
ional.com 
[EMAIL PROTECTED]  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 09:54 AMSubject: RE: Connection 
between TOMCAT and
Please respond to Tomcat  DB2 ??? 
  
Users List
  
   
  
   
  





Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Mike

I don't understand by what you mean by 100% java native. But yes I am sure
that if I run my java code by placing my java file in C:\Program
Files\SQLLIB\bin directory
it works absolutely fine hence I can say it is java native to DB2
directory.

But I cannot make the same file run from outside the DB2 realm...that is
when I place same java file in TOMCAT_HOME directory it doesnot find the
driver...

DO I need to make changes in my server.xml file in %TOMCAT_HOME%\conf and
add some context
ot do I need to add some Realm information ???

Thanks


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Michael Remijan  
  
Michael.Remijan@soTo: Tomcat Users List 
  
locup.com [EMAIL PROTECTED]
  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:13 AMSubject: RE: Connection between 
TOMCAT and
Please respond to  DB2 ??? 
  
Tomcat Users List
  
   
  
   
  





...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance






Turner,
JohnTo: 'Tomcat Users List'
JTurner@AAS.[EMAIL PROTECTED]
com cc: (bcc: Nishant Awasthi)
 Subject: RE: Connection
between TOMCAT and
07/31/2002   DB2 ???
09:27 AM
Please
respond to
Tomcat Users
List








Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks






Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





--
To unsubscribe, e-mail

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello Mark,

Both of the servers
DB2 JDBC Applet Server and
DB2 JDBC Applet Server - Control Center are running...




Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Sullivan, Mark E 
  
Mark.Sullivan@nav-internatTo: 'Tomcat Users List' 
  
ional.com 
[EMAIL PROTECTED]  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:08 AMSubject: RE: Connection 
between TOMCAT and
Please respond to Tomcat  DB2 ??? 
  
Users List
  
   
  
   
  





you also have to have the 'IBM JDBC APPLET SERVER' running.

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:14 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???


...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath  then restarted TOMCAT but still it
couldn't find driver.

DO I need to do something special for my JAVA file in tomcat to find
DB2driver

Please help
thanks






Nishant Awasthi
Corporate Systems Development
Progressive Insurance





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

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





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

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Sullivan, Mark E

If your db2driver.zip/jar file was not being found, then it would through a
ClassNotFoundException. Your error is due to using an invalid connection
string for the kind of driver you are using. For example, using the
following combination will through a no suitable driver exeception:

String conn = jdbc:db2://obtasdne/FLBP;
Class.forName(COM.ibm.db2.jdbc.app.DB2Driver);
con = DriverManager.getConnection(conn);

This is an example of where you should use the .net driver. Check your
connection string. That's where your problem is

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:35 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





 

Sullivan, Mark E

Mark.Sullivan@nav-internatTo: 'Tomcat Users
List'   
ional.com
[EMAIL PROTECTED]  
   cc: (bcc: Nishant
Awasthi)
07/31/2002 09:54 AMSubject: RE:
Connection between TOMCAT and
Please respond to Tomcat  DB2 ???

Users List

 

 






Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Michael Remijan

No,

It should be as simple as dropping the xxx.jar file (if it's xxx.zip rename it to 
xxx.jar!) into the %TOMCAT_HOME%/common/lib directory.

I would do/verify the following

1) put tomcat in a directory structure where the names of the directories don't 
contain spaces
2) make sure TOMCAT_HOME is set
3) make sure CATALINA_HOME=%TOMCAT_HOME%
4) copy xxx.jar to %TOMCAT_HOME%/common/lib 
5) open a new DOS window to get the new values of the environment variables
6) change directory to %TOMCAT_HOME%/bin
7) issue c:\..catalina.bat run
8) if it's still not working it's probably becuase the drivers are not 100% java and 
rely on native method calls to some dll.   


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:40 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Mike

I don't understand by what you mean by 100% java native. But yes I am sure
that if I run my java code by placing my java file in C:\Program
Files\SQLLIB\bin directory
it works absolutely fine hence I can say it is java native to DB2
directory.

But I cannot make the same file run from outside the DB2 realm...that is
when I place same java file in TOMCAT_HOME directory it doesnot find the
driver...

DO I need to make changes in my server.xml file in %TOMCAT_HOME%\conf and
add some context
ot do I need to add some Realm information ???

Thanks


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Michael Remijan  
  
Michael.Remijan@soTo: Tomcat Users List 
  
locup.com [EMAIL PROTECTED]
  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:13 AMSubject: RE: Connection between 
TOMCAT and
Please respond to  DB2 ??? 
  
Tomcat Users List
  
   
  
   
  





...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance






Turner,
JohnTo: 'Tomcat Users List'
JTurner@AAS.[EMAIL PROTECTED]
com cc: (bcc: Nishant Awasthi)
 Subject: RE: Connection
between TOMCAT and
07/31/2002   DB2 ???
09:27 AM
Please
respond to
Tomcat Users
List








Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Turner, John


and 7.5) verify that the connection string inside the code is correct

John Turner
[EMAIL PROTECTED]

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 10:52 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???


No,

It should be as simple as dropping the xxx.jar file (if it's xxx.zip rename
it to xxx.jar!) into the %TOMCAT_HOME%/common/lib directory.

I would do/verify the following

1) put tomcat in a directory structure where the names of the directories
don't contain spaces
2) make sure TOMCAT_HOME is set
3) make sure CATALINA_HOME=%TOMCAT_HOME%
4) copy xxx.jar to %TOMCAT_HOME%/common/lib 
5) open a new DOS window to get the new values of the environment variables
6) change directory to %TOMCAT_HOME%/bin
7) issue c:\..catalina.bat run
8) if it's still not working it's probably becuase the drivers are not 100%
java and rely on native method calls to some dll.   


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:40 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Mike

I don't understand by what you mean by 100% java native. But yes I am sure
that if I run my java code by placing my java file in C:\Program
Files\SQLLIB\bin directory
it works absolutely fine hence I can say it is java native to DB2
directory.

But I cannot make the same file run from outside the DB2 realm...that is
when I place same java file in TOMCAT_HOME directory it doesnot find the
driver...

DO I need to make changes in my server.xml file in %TOMCAT_HOME%\conf and
add some context
ot do I need to add some Realm information ???

Thanks



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





 

Michael Remijan

Michael.Remijan@soTo: Tomcat Users List

locup.com
[EMAIL PROTECTED]  
   cc: (bcc: Nishant
Awasthi)
07/31/2002 10:13 AMSubject: RE: Connection
between TOMCAT and
Please respond to  DB2 ???

Tomcat Users List

 

 






...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance






Turner,
JohnTo: 'Tomcat Users List'
JTurner@AAS.[EMAIL PROTECTED]
com cc: (bcc: Nishant Awasthi)
 Subject: RE: Connection
between TOMCAT and
07/31/2002   DB2 ???
09:27 AM
Please
respond to
Tomcat Users
List








Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks for showing interest in the list and to make it grow...

I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.

Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes

Now it compile fine but when I try to run it it says:

 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java

 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception:  No suitable driver

I have tried to put db2java.zip, runtime.zip

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread O'Gara, Damian
Title: RE: Connection between TOMCAT and DB2 ???





Hi


Tomcat only looks for .jar files and not .zip
Rename your .zip to .jar


Damian


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July 2002 15:35
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???




Hello Mark,


I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.


I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver


I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java


DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?


I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
 stored in a database and accessed via JDBC --


I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...


Can you guide me in some other way?



Nishant Awasthi
Corporate Systems Development
Progressive Insurance






 
 Sullivan, Mark E 
 Mark.Sullivan@nav-internat To: 'Tomcat Users List' 
 ional.com [EMAIL PROTECTED] 
 cc: (bcc: Nishant Awasthi) 
 07/31/2002 09:54 AM Subject: RE: Connection between TOMCAT and 
 Please respond to Tomcat DB2 ??? 
 Users List 
 
 






Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???




Hello John,


It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin


directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...


Any other tries..?






Nishant Awasthi
Corporate Systems Development
Progressive Insurance








 Turner,


 John To: 'Tomcat Users List'


 JTurner@AAS. [EMAIL PROTECTED]


 com cc: (bcc: Nishant Awasthi)


 Subject: RE: Connection
between
TOMCAT and
 07/31/2002 DB2 ???


 09:27 AM


 Please


 respond to


 Tomcat Users


 List












Try renaming your .zip files to .jar files. Just change the extension from
.zip to .jar without changing the files themselves.


John Turner
[EMAIL PROTECTED]


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???



Hello everyone...
thanks for showing interest in the list and to make it grow...


I have a situation here.
I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
service which will bring the resultset from IBM DB2 database.


Before implementing soap I am writing a simple Java Ndb2servlet.java file
inside
%TOMCAT_HOME%\webapps\soap\WEB-INF\classes


Now it compile fine but when I try to run it it says:


 COMPILING C:
\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjavac Ndb2servlet.java


 RUNNING C:\jakarta-tomcat-4.0.4\webapps\soap\WEB-INF\classesjava
Ndb2servlet
SQL Exception: No suitable driver


I have tried to put db2java.zip, runtime.zip and sqlj.zip in %TOMCAT_HOME%
\common\lib and
and also included in system classpath then restarted TOMCAT but still it
couldn't find driver.


DO I need to do something special for my JAVA file in tomcat to find
DB2driver


Please help
thanks









Nishant Awasthi
Corporate Systems Development
Progressive Insurance






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


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






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


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






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

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello Mark

I think you are right Mark when You say that, it is do finding the
db2jaa.jar/zip file
but question is why it is not getting COM.ibm.db2.jdbc.app.DB2Driver
which is placed in db2java.zip/db2java.zip.jar file.

This is the source code of the file I am trying to run undr tomcat


import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from the
database...);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(SELECT * from
db2admin.employee);

   System.out.println(Received results:);

   while (rs.next())
   {
 String a = rs.getString(1);
   String str = rs.getString(2);

   System.out.print( empno=  + a);
   System.out.print( firstname=  + str);
   System.out.print(\n);
   }
   rs.close();
   stmt.close();
con.close();
}
catch (SQLException e1)
{
  System.out.println(SQL Exception:  + e1.getMessage
() + \n);
}

  }
}


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Sullivan, Mark E 
  
Mark.Sullivan@nav-internatTo: 'Tomcat Users List' 
  
ional.com 
[EMAIL PROTECTED]  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:41 AMSubject: RE: Connection 
between TOMCAT and
Please respond to Tomcat  DB2 ??? 
  
Users List
  
   
  
   
  





If your db2driver.zip/jar file was not being found, then it would through a
ClassNotFoundException. Your error is due to using an invalid connection
string for the kind of driver you are using. For example, using the
following combination will through a no suitable driver exeception:

 String conn = jdbc:db2://obtasdne/FLBP;
 Class.forName(COM.ibm.db2.jdbc.app.DB2Driver);
 con = DriverManager.getConnection(conn);

This is an example of where you should use the .net driver. Check your
connection string. That's where your problem is

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:35 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Sullivan, Mark E

look here:

http://www-3.ibm.com/software/data/db2/java/v5/faq.html#q7

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:59 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark

I think you are right Mark when You say that, it is do finding the
db2jaa.jar/zip file
but question is why it is not getting COM.ibm.db2.jdbc.app.DB2Driver
which is placed in db2java.zip/db2java.zip.jar file.

This is the source code of the file I am trying to run undr tomcat


import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from the
database...);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(SELECT * from
db2admin.employee);

   System.out.println(Received results:);

   while (rs.next())
   {
 String a = rs.getString(1);
   String str = rs.getString(2);

   System.out.print( empno=  + a);
   System.out.print( firstname=  + str);
   System.out.print(\n);
   }
   rs.close();
   stmt.close();
con.close();
}
catch (SQLException e1)
{
  System.out.println(SQL Exception:  + e1.getMessage
() + \n);
}

  }
}



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





 

Sullivan, Mark E

Mark.Sullivan@nav-internatTo: 'Tomcat Users
List'   
ional.com
[EMAIL PROTECTED]  
   cc: (bcc: Nishant
Awasthi)
07/31/2002 10:41 AMSubject: RE:
Connection between TOMCAT and
Please respond to Tomcat  DB2 ???

Users List

 

 






If your db2driver.zip/jar file was not being found, then it would through a
ClassNotFoundException. Your error is due to using an invalid connection
string for the kind of driver you are using. For example, using the
following combination will through a no suitable driver exeception:

 String conn = jdbc:db2://obtasdne/FLBP;
 Class.forName(COM.ibm.db2.jdbc.app.DB2Driver);
 con = DriverManager.getConnection(conn);

This is an example of where you should use the .net driver. Check your
connection string. That's where your problem is

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:35 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello Michael,

I am doing exactly what you said.
I have placed my .zip files which I rename as .jar files and placed them in
c:\jakarta-tomcat-4.0.3\common\lib.

I had all my tomcat environment variables properly set and tomcat runs
fine...
but When I run the java file on c:\jakarta-tomcat-4.0.3\webapps\soap
WEB_INF\classes folder it couldn't find the suitable driver to run my java
file.

So now do you think the drivers are not 100% java and rely on native method
calls to some dll?
What typr of dll should I look for?
Thanks,


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Michael Remijan  
  
Michael.Remijan@soTo: Tomcat Users List 
  
locup.com [EMAIL PROTECTED]
  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:51 AMSubject: RE: Connection between 
TOMCAT and
Please respond to  DB2 ??? 
  
Tomcat Users List
  
   
  
   
  





No,

It should be as simple as dropping the xxx.jar file (if it's xxx.zip rename
it to xxx.jar!) into the %TOMCAT_HOME%/common/lib directory.

I would do/verify the following

1) put tomcat in a directory structure where the names of the directories
don't contain spaces
2) make sure TOMCAT_HOME is set
3) make sure CATALINA_HOME=%TOMCAT_HOME%
4) copy xxx.jar to %TOMCAT_HOME%/common/lib
5) open a new DOS window to get the new values of the environment variables
6) change directory to %TOMCAT_HOME%/bin
7) issue c:\..catalina.bat run
8) if it's still not working it's probably becuase the drivers are not 100%
java and rely on native method calls to some dll.


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:40 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Mike

I don't understand by what you mean by 100% java native. But yes I am sure
that if I run my java code by placing my java file in C:\Program
Files\SQLLIB\bin directory
it works absolutely fine hence I can say it is java native to DB2
directory.

But I cannot make the same file run from outside the DB2 realm...that is
when I place same java file in TOMCAT_HOME directory it doesnot find the
driver...

DO I need to make changes in my server.xml file in %TOMCAT_HOME%\conf and
add some context
ot do I need to add some Realm information ???

Thanks



Nishant Awasthi
Corporate Systems Development
Progressive Insurance






Michael Remijan
Michael.Remijan@soTo: Tomcat Users List
locup.com
[EMAIL PROTECTED]
   cc: (bcc: Nishant
Awasthi)
07/31/2002 10:13 AMSubject: RE: Connection
between TOMCAT and
Please respond to  DB2 ???
Tomcat Users List







...

Here's a thought.  are the drivers for DB2 100% java native.  I'm
remembering a problem a colleage of mind had using the the jdbc drivers for
a database named Progress.  It turns out they were not 100% java and relied
on calls to native libraries.  If you're running on windows it'll be a dll
or something.

mike/

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance






Turner,
JohnTo: 'Tomcat Users List'
JTurner@AAS.[EMAIL PROTECTED]
com cc: (bcc: Nishant Awasthi

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi



Hello John

This is the source code of the file I am trying to run under tomcat
Is there any problem with connection string ???
It is working fine in %SQLLIB%\bin directory
Here's the code

import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from the
database...);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(SELECT * from
db2admin.employee);

   System.out.println(Received results:);

   while (rs.next())
   {
 String a = rs.getString(1);
   String str = rs.getString(2);

   System.out.print( empno=  + a);
   System.out.print( firstname=  + str);
   System.out.print(\n);
   }
   rs.close();
   stmt.close();
con.close();
}
catch (SQLException e1)
{
  System.out.println(SQL Exception:  + e1.getMessage
() + \n);
}

  }
}


Nishant Awasthi
Corporate Systems Development
Progressive Insurance




   

Turner,   

JohnTo: 'Tomcat Users List'   

JTurner@AAS.[EMAIL PROTECTED]  

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between TOMCAT 
and
07/31/2002   DB2 ???   

10:53 AM   

Please 

respond to 

Tomcat Users  

List  

   

   







and 7.5) verify that the connection string inside the code is correct

John Turner
[EMAIL PROTECTED]

-Original Message-
From: Michael Remijan [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 10:52 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???


No,

It should be as simple as dropping the xxx.jar file (if it's xxx.zip rename
it to xxx.jar!) into the %TOMCAT_HOME%/common/lib directory.

I would do/verify the following

1) put tomcat in a directory structure where the names of the directories
don't contain spaces
2) make sure TOMCAT_HOME is set
3) make sure CATALINA_HOME=%TOMCAT_HOME%
4) copy xxx.jar to %TOMCAT_HOME%/common/lib
5) open a new DOS window to get the new values of the environment variables
6) change directory to %TOMCAT_HOME%/bin
7) issue c:\..catalina.bat run
8) if it's still not working it's probably becuase the drivers are not 100%
java

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello Damien,

I have already converted my .zip files to.jar files.
I think as majority of the responses says..there is some problem with the
connection string and driver URL I should look into it..

Any suggestions on this

Class.forName(COM.ibm.db2.jdbc.net.DB2Driver);
String url = jdbc:db2:sample;
con = DriverManager.getConnection(url);


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
O'Gara, Damian   
  
Damian.O'[EMAIL PROTECTED]To: 'Tomcat Users List'   
  
ens.co.uk [EMAIL PROTECTED]
  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:57 AMSubject: RE: Connection between 
TOMCAT and
Please respond to  DB2 ??? 
  
Tomcat Users List
  
   
  
   
  





Hi

Tomcat only looks for .jar files and not .zip
Rename your .zip to .jar

Damian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July 2002 15:35
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Sullivan, Mark E

Mark.Sullivan@nav-internatTo: 'Tomcat
Users
List'
ional.com
[EMAIL PROTECTED]
   cc: (bcc:
Nishant
Awasthi)
07/31/2002 09:54 AMSubject: RE:
Connection between TOMCAT and
Please respond to Tomcat  DB2 ???

Users List










Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?





Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Turner, John


I don't have any experience with DB2, so I'm not sure how much help I can
be.  

Two things I noticed: you don't check for valid values or null for userid
and passwd.  Are the usernames and passwords you are using valid on that
database?

Also, according to this URL:
http://www-3.ibm.com/software/data/db2/java/v5/faq.html#q7  if you are using
the app driver your URL should look like this:
jdbc:db2://server:port/database. 

Shouldn't you be using the net driver if you are trying to connect through
a servlet?

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:10 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???




Hello John

This is the source code of the file I am trying to run under tomcat
Is there any problem with connection string ???
It is working fine in %SQLLIB%\bin directory
Here's the code

import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from the
database...);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(SELECT * from
db2admin.employee);

   System.out.println(Received results:);

   while (rs.next())
   {
 String a = rs.getString(1);
   String str = rs.getString(2);

   System.out.print( empno=  + a);
   System.out.print( firstname=  + str);
   System.out.print(\n);
   }
   rs.close();
   stmt.close();
con.close();
}
catch (SQLException e1)
{
  System.out.println(SQL Exception:  + e1.getMessage
() + \n);
}

  }
}



Nishant Awasthi
Corporate Systems Development
Progressive Insurance




 


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




RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Sexton, George

The one time I used it, my driver class was:


COM.ibm.db2.jdbc.app.DB2Driver

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July, 2002 9:22 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Damien,

I have already converted my .zip files to.jar files.
I think as majority of the responses says..there is some problem with the
connection string and driver URL I should look into it..

Any suggestions on this

Class.forName(COM.ibm.db2.jdbc.net.DB2Driver);
String url = jdbc:db2:sample;
con = DriverManager.getConnection(url);



Nishant Awasthi
Corporate Systems Development
Progressive Insurance






O'Gara, Damian
Damian.O'[EMAIL PROTECTED]To: 'Tomcat Users
List'
ens.co.uk
[EMAIL PROTECTED]
   cc: (bcc: Nishant
Awasthi)
07/31/2002 10:57 AMSubject: RE:
Connection between TOMCAT and
Please respond to  DB2 ???
Tomcat Users List







Hi

Tomcat only looks for .jar files and not .zip
Rename your .zip to .jar

Damian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July 2002 15:35
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?




Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Sullivan, Mark E

Mark.Sullivan@nav-internatTo: 'Tomcat
Users
List'
ional.com
[EMAIL PROTECTED]
   cc: (bcc:
Nishant
Awasthi)
07/31/2002 09:54 AMSubject: RE:
Connection between TOMCAT and
Please respond to Tomcat  DB2 ???

Users List










Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I didn't worked.
It is not finding the driver even now...I tried printing the
classpath..though it shows the
all 3 .jar files included but it is working only in %SQLLIB%\bin

directory that is if I try to run my file by keeping it in %SQLLIB%\bin
directory
it worked fine and retieve resultsets from database but
not from TOMCAT_HOME directory...

Any other tries..?





Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Turner,

JohnTo: 'Tomcat Users List'

JTurner@AAS.[EMAIL PROTECTED]

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection
between
TOMCAT and
07/31/2002   DB2 ???

09:27 AM

Please

respond to

Tomcat Users

List











Try renaming your .zip files to .jar files.  Just change the extension from
.zip to .jar without changing the files themselves.

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:22 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: Connection between TOMCAT and DB2 ???


Hello everyone...
thanks

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Mark

I think you have sent an absolutely needed links...
It seems as the link suggests, it is the problem with
jdbc:db2:sample
I need something like
jdbc:db2://n5533030:5/sample where
 my database is sample
and port (actually I don't know what is my prt but I picked ): 5

To find the port I looked into the services file and found:
db2cDB2MPP  5/tcp #connection port for the DB2 instance
DB2MPP
db2iDB2MPP  50001/tcp #interrupt port for the DB2 instance
DB2MPP
DB2CCMSRV   50006/tcp #DB2 Performance Monitor Listener
db2cDB2DAS00  523/tcp #connection port for the DB2 instance
DB2DAS00
db2iDB2DAS00  524/tcp #interrupt port for the DB2 instance
DB2DAS00
DB2_DB2MPP  50007/tcp
DB2_DB2MPP_END  50010/tcp

There are all the port informaiton I can find...Since while installing I
had Db2MPP
instance created...I picked up 5 as my jdbc URL port.

AwwIs didn't work
I appreciate your help,


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
  
Sullivan, Mark E 
  
Mark.Sullivan@nav-internatTo: 'Tomcat Users List' 
  
ional.com 
[EMAIL PROTECTED]  
   cc: (bcc: Nishant Awasthi)  
  
07/31/2002 10:57 AMSubject: RE: Connection 
between TOMCAT and
Please respond to Tomcat  DB2 ??? 
  
Users List
  
   
  
   
  





look here:

http://www-3.ibm.com/software/data/db2/java/v5/faq.html#q7

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 9:59 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark

I think you are right Mark when You say that, it is do finding the
db2jaa.jar/zip file
but question is why it is not getting COM.ibm.db2.jdbc.app.DB2Driver
which is placed in db2java.zip/db2java.zip.jar file.

This is the source code of the file I am trying to run undr tomcat


import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from the
database...);
   Statement stmt = con.createStatement();
   ResultSet rs = stmt.executeQuery(SELECT * from
db2admin.employee);

   System.out.println(Received results:);

   while (rs.next())
   {
 String a = rs.getString(1);
   String str = rs.getString(2);

   System.out.print( empno=  + a);
   System.out.print( firstname=  + str);
   System.out.print(\n);
   }
   rs.close();
   stmt.close

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello John,

I think you have sent an absolutely needed links...
It seems as the link suggests, it is the problem with
jdbc:db2:sample
I need something like
jdbc:db2://n5533030:5/sample where
 my database is sample
and port (actually I don't know what is my prt but I picked ): 5

To find the port I looked into the services file and found:
db2cDB2MPP  5/tcp #connection port for the DB2 instance
DB2MPP
db2iDB2MPP  50001/tcp #interrupt port for the DB2 instance
DB2MPP
DB2CCMSRV   50006/tcp #DB2 Performance Monitor Listener
db2cDB2DAS00  523/tcp #connection port for the DB2 instance
DB2DAS00
db2iDB2DAS00  524/tcp #interrupt port for the DB2 instance
DB2DAS00
DB2_DB2MPP  50007/tcp
DB2_DB2MPP_END  50010/tcp

There are all the port informaiton I can find...Since while installing I
had Db2MPP
instance created...I picked up 5 as my jdbc URL port.

and Yes, I tried using both .app and .net in my connection string it didn't
work...

AwwIs didn't work
I appreciate your help,


Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   

Turner,   

JohnTo: 'Tomcat Users List'   

JTurner@AAS.[EMAIL PROTECTED]  

com cc: (bcc: Nishant Awasthi)

 Subject: RE: Connection between TOMCAT 
and
07/31/2002   DB2 ???   

11:22 AM   

Please 

respond to 

Tomcat Users  

List  

   

   







I don't have any experience with DB2, so I'm not sure how much help I can
be.

Two things I noticed: you don't check for valid values or null for userid
and passwd.  Are the usernames and passwords you are using valid on that
database?

Also, according to this URL:
http://www-3.ibm.com/software/data/db2/java/v5/faq.html#q7  if you are
using
the app driver your URL should look like this:
jdbc:db2://server:port/database.

Shouldn't you be using the net driver if you are trying to connect
through
a servlet?

John Turner
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 11:10 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???




Hello John

This is the source code of the file I am trying to run under tomcat
Is there any problem with connection string ???
It is working fine in %SQLLIB%\bin directory
Here's the code

import java.sql.*;
import java.lang.*;
import java.io.*;

public class Ndb2servlet{

   public static void main(String args[]) {


try{
  Class.forName
(COM.ibm.db2.jdbc.app.DB2Driver).newInstance();
}
catch( Exception e)
{
   System.out.println(\nDriver class not found
exception);
}

 try{
   Connection con = null;

 // URL is jdbc:db2:dbname
String url = jdbc:db2:sample;

if (args.length == 0)
   {
   // connect with default id/password
  con = DriverManager.getConnection(url);
}
else if (args.length == 2)
 {
String userid = args[0];
String passwd = args[1];

   // connect with user-provided username and
password
   con = DriverManager.getConnection(url, userid,
passwd);
}
else
   {
 System.out.println(\nUsage: java Ndb2servlet
[username password]\n);
 System.exit(0);
}

   // retrieve data from the database
   System.out.println(Retrieve some data from

RE: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Hello George,

I tried both the URLs..

COM.ibm.db2.jdbc.app.DB2Driver
COM.ibm.db2.jdbc.net.DB2Driver



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   
 
Sexton,   
 
George   To: Tomcat Users List  
 
gsexton@mhsof[EMAIL PROTECTED] 
 
tware.comcc: (bcc: Nishant Awasthi)   
 
  Subject: RE: Connection between TOMCAT 
and
07/31/2002DB2 ???  
 
11:27 AM   
 
Please respond 
 
to Tomcat 
 
Users List
 
   
 
   
 





The one time I used it, my driver class was:


COM.ibm.db2.jdbc.app.DB2Driver

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July, 2002 9:22 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Damien,

I have already converted my .zip files to.jar files.
I think as majority of the responses says..there is some problem with the
connection string and driver URL I should look into it..

Any suggestions on this

Class.forName(COM.ibm.db2.jdbc.net.DB2Driver);
String url = jdbc:db2:sample;
con = DriverManager.getConnection(url);




Nishant Awasthi
Corporate Systems Development
Progressive Insurance






O'Gara, Damian
Damian.O'[EMAIL PROTECTED]To: 'Tomcat Users
List'
ens.co.uk
[EMAIL PROTECTED]
   cc: (bcc: Nishant
Awasthi)
07/31/2002 10:57 AMSubject: RE:
Connection between TOMCAT and
Please respond to  DB2 ???
Tomcat Users List







Hi

Tomcat only looks for .jar files and not .zip
Rename your .zip to .jar

Damian

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: 31 July 2002 15:35
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello Mark,

I am currently using COM.ibm.db2.jdbc.app.DB2Driver driver to run my
simple
java program for establishing DB2-Tomcat connectivity.

I tried changing it to COM.ibm.db2.jdbc.net.DB2Driver still it says,
No suitable driver

I think my tomcat is not able to find out db2java.zip file which is placed
in
C:\Program Files\SQLLIB\java

DO I need to add some contextpath in server.xml of TOMCAT to tell tomcat to
look for
DB2 jdbc driver in %SQLLIB%\java directory?

I was looking at server.xml in TOMCAT and found that there is something
called Realm /
comment above which says
!-- Replace the above Realm with one of the following to get a Realm
   stored in a database and accessed via JDBC --

I tried changing it to DB2 compatible information..but didn't worked...I
had problem starting tomcat...

Can you guide me in some other way?





Nishant Awasthi
Corporate Systems Development
Progressive Insurance







Sullivan, Mark E

Mark.Sullivan@nav-internatTo: 'Tomcat
Users
List'
ional.com
[EMAIL PROTECTED]
   cc: (bcc:
Nishant
Awasthi)
07/31/2002 09:54 AMSubject: RE:
Connection between TOMCAT and
Please respond to Tomcat  DB2 ???

Users List










Who's DB2 jdbc driver are you trying to use? If you're using the IBM
implementation, you can either load the
COM.ibm.db2.jdbc.net.DB2Driver or the COM.ibm.db2.jdbc.app.DB2Driver If
you use the wrong one, you will get a No suitable driver exception. The
correct one depends on the situation, and in this case it's probably the
.net one.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 8:46 AM
To: Tomcat Users List
Subject: RE: Connection between TOMCAT and DB2 ???



Hello John,

It was a nice thinking but I

Re: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Ryszard Lach

On Wed, Jul 31, 2002 at 09:21:59AM -0400, [EMAIL PROTECTED] wrote:
 Hello everyone...
 thanks for showing interest in the list and to make it grow...
 
 I have a situation here.
 I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
 service which will bring the resultset from IBM DB2 database.
 

I'm sorry, I don't have a time to read the all thread. Did you manage to
connect to DB2 from tomcat ? If not - I did, so I think I could help
you. 

Richard

-- 
** Internet Designers S.A., ul. Przedmiejska 6-10, 54-201 Wrocaw **
 tel. (071) 35 00 445 w. 25; fax (071) 37 35 946; http://www.id.pl/

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




Re: Connection between TOMCAT and DB2 ???

2002-07-31 Thread Nishant_Awasthi


Thanks Richard for your help,

Yes, just now I managed to connect DB2 to Tomcat and using simple java file
able to retrieve the values from sample database.

But I have a question for you.
while defining my Connection URL I never specified a port number.
  String url = jdbc:db2://100.3.13.34/sample;

If you see above I just gave IP address of my machine and not port number.
In past cases I have used port number given to me by the DBA.

I would like to know what is the importance of port number and which
service is running on this port.



Nishant Awasthi
Corporate Systems Development
Progressive Insurance





   

Ryszard Lach   

[EMAIL PROTECTED]  To: Tomcat Users List 

 [EMAIL PROTECTED]  

07/31/2002   cc: (bcc: Nishant Awasthi)

02:43 PM Subject: Re: Connection between TOMCAT 
and
Please   DB2 ???   

respond to 

Tomcat Users  

List  

   

   






On Wed, Jul 31, 2002 at 09:21:59AM -0400, [EMAIL PROTECTED]
wrote:
 Hello everyone...
 thanks for showing interest in the list and to make it grow...

 I have a situation here.
 I am using tomcat 4.0.3 and jdk 1.3.1_04. I want to write a soap
 service which will bring the resultset from IBM DB2 database.


I'm sorry, I don't have a time to read the all thread. Did you manage to
connect to DB2 from tomcat ? If not - I did, so I think I could help
you.

Richard

--
** Internet Designers S.A., ul. Przedmiejska 6-10, 54-201 Wrocaw **
 tel. (071) 35 00 445 w. 25; fax (071) 37 35 946; http://www.id.pl/

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





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