Solved

could not connect with database on remote machine.

Posted on 2006-07-11
5
530 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
  • 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 to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

-Xmx and -Xms are the two JVM options often used to tune JVM heap size.   Here are some common mistakes made when using them:   Assume BigApp is a java class file for the below examples. 1.         Missing m, M, g or G at the end …
This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now