Solved

could not connect with database on remote machine.

Posted on 2006-07-11
5
535 Views
Last Modified: 2013-12-10
Hi,

I have websphere studio 5 with test envoirment 4.
I want to access database on remote machine but getting the following error:

javax.naming.NameNotFoundException: jdbc/dbtest

In my web.xml file I had defined:

<context-param>
  <param-name>datasource</param-name>
  <param-value>dbtest</param-value>
  <description>for testing</description>
  </context-param>
 <context-param>
  <param-name>ISUSER</param-name>
  <param-value>testuser</param-value>
  <description>login id</description>
  </context-param>
 <context-param>
  <param-name>ISPWD</param-name>
  <param-value>testpwd</param-value>
  <description>password to login</description>
  </context-param>
 <context-param>
  <param-name>ISHOST</param-name>
  <param-value>testMachine</param-value>
  <description>db machine name</description>
  </context-param>


I tried to search on web, it looks that I need to data source created on my machine.

Please somebody answer the following things.
0) Do I need the data source?
1) I have no admin console, so do I need to admin console to create data source.
2) Do I need to install admin console separately or websphre studio 5 installation itself contain the admin console.
3) How to run admin console.

If data source is no needed then what is solution to get rid of above error and connect with the database.


0
Comment
Question by:alakhan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:anumalas
ID: 17089452
Hi

yes you need data source.

you can configure data source by putting some env information in web.xml

add the fowlling code to your web.xml and try

<env-entry>
    <env-entry-name>jdbc/{DataSourceName}</env-entry-name>
    <env-entry-value>
    !{DriverName}!{ConnectionURL}
    </env-entry-value>
    <env-entry-type>java.lang.String</env-entry-type>
</env-entry>

some times there is some problem with custom installation . please do the follow steps to install admin console

Run the following commands from %WAS_HOME%/bin folder

 

wsadmin.bat "$AdminApp uninstall adminconsole" -port 2011


wsadmin.bat "$AdminApp install  c:/websphere5.0/AppServer/bin/installedApps/nvad2836/adminconsole.ear {-cell nvad2836 -node nvad2836_mydomain -server server1" -port 2011

Port 2011 is the soap connector port which can be verified in your configuration in portdef.properties.

other properties cell, node, server can be checked in sertversataenv.bat

if port  2011 is in use with other profile or cell, change the port number and try again .

If you have any doubts using wsadmin.bat see the help  like follow %WAS_HOME%\bin> wsadmin --help

Hope this will solve your problem :)

0
 

Author Comment

by:alakhan
ID: 17090825
One more thing:
I just fig. out that I dont have jdbc driver installed on my machine. I am running windows/websphre 5 studio and using ver. 4 test envoirment to run the web application. The database on remote server is db2 running on iSeries.
I think I need jdbc driver of db2 of type 4. Can you give me link to download that driver and is it need to be specific for db2 on iseries?
0
 

Author Comment

by:alakhan
ID: 17092452
One more thing, I dont have admin console on my machine. I had mentioned the param list and values. can you explain according to the above values what will be the code?
0
 

Author Comment

by:alakhan
ID: 17094554
I just found that previously they were using IBM tool box. I included the dt400.jar file into project path and create a connection but when i try to execute query it says that file does not found.

Can you tell me just how to make connection with IBM Tool box libaray and execute a simple query????
0
 
LVL 3

Accepted Solution

by:
anumalas earned 250 total points
ID: 17096824
Hi

For your first question  you need to install db2udb client to get the type 4 driver please refer following link

http://www-128.ibm.com/developerworks/db2/library/techarticle/0307zikopoulos/0307zikopoulos.html

For your second question you need to add above mentioned entries in web.xml with your db2 type 4 dirver and url of that driver

excluding your 2 questions, for your third question  please refer the following 2 links and see sample programs

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzahh/page1.htm

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzahh/download.htm

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rzahh/jdbc2.htm

Hope this will help :)
0

Featured Post

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Verbose logging is used to diagnose garbage collector problems. By default, -verbose:gc output is written to either native_stderr.log or native_stdout.log.   It is also possible to redirect the logs to a user-specified file. This article will de…
This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question