could not connect with database on remote machine.

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.


alakhanAsked:
Who is Participating?
 
anumalasConnect With a Mentor Commented:
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
 
anumalasCommented:
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
 
alakhanAuthor Commented:
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
 
alakhanAuthor Commented:
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
 
alakhanAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.