Link to home
Start Free TrialLog in
Avatar of alakhan
alakhan

asked on

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.


Avatar of anumalas
anumalas

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 :)

Avatar of alakhan

ASKER

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?
Avatar of alakhan

ASKER

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?
Avatar of alakhan

ASKER

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????
ASKER CERTIFIED SOLUTION
Avatar of anumalas
anumalas

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial