Meaningless Drivel is fun!*
The moose likes Websphere and the fly likes WAS 6.1 JDBC problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "WAS 6.1 JDBC problem" Watch "WAS 6.1 JDBC problem" New topic
Author

WAS 6.1 JDBC problem

Francisco Javier Haro Rodr�guez
Greenhorn

Joined: Oct 06, 2008
Posts: 3
Hello,

i am having a problem in my preproduction websphere server with the conection to the database. The server use the wrong jdbc driver for my datasource. In my local server all is ok. Can you help me?

The log output is (preproduction server with the error):

===========================================================================================================
[29/09/08 16:31:51:475 CEST] 00000014 InternalOracl I DSRA8203I: Nombre del producto Database: Oracle
[29/09/08 16:31:51:490 CEST] 00000014 InternalOracl I DSRA8204I: Versi�n del producto Database: Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
With the Partitioning option
JServer Release 8.1.7.4.1 - Production
[29/09/08 16:31:51:506 CEST] 00000014 InternalOracl I DSRA8205I: Nombre del controlador JDBC: Oracle JDBC driver
[29/09/08 16:31:51:506 CEST] 00000014 InternalOracl I DSRA8206I: Versi�n del controlador JDBC: 8.1.7.0.0
[29/09/08 16:31:51:537 CEST] 00000014 InternalOracl I DSRA8212I: El nombre de DataStoreHelper es: com.ibm.websphere.rsadapter.OracleDataStoreHelper@2abc2abc.
[29/09/08 16:31:51:584 CEST] 00000012 ResourceMgrIm I WSVR0049I: Se enlaza DefaultEJBTimerDataSource como jdbc/DefaultEJBTimerDataSource
[29/09/08 16:31:51:600 CEST] 00000014 WSRdbDataSour I DSRA8208I: Tipo de controlador JDBC : ""
===========================================================================================================



In my local server (all ok):

===========================================================================================================
[30/09/08 17:05:35:628 CEST] 00000018 InternalOracl I DSRA8203I: Nombre del producto Database: Oracle
[30/09/08 17:05:35:643 CEST] 00000018 InternalOracl I DSRA8204I: Versi�n del producto Database: Oracle8i Enterprise Edition Release 8.1.7.4.1 - Production
With the Partitioning option
JServer Release 8.1.7.4.1 - Production
[30/09/08 17:05:35:643 CEST] 00000018 InternalOracl I DSRA8205I: Nombre del controlador JDBC: Oracle JDBC driver
[30/09/08 17:05:35:643 CEST] 00000018 InternalOracl I DSRA8206I: Versi�n del controlador JDBC: 10.2.0.3.0
[30/09/08 17:05:35:659 CEST] 00000018 InternalOracl I DSRA8212I: El nombre de DataStoreHelper es: com.ibm.websphere.rsadapter.OracleDataStoreHelper@62da62da.
[30/09/08 17:05:35:737 CEST] 00000018 InternalOracl W DSRA7019W: Se debe utilizar Oracle10gDataStoreHelper o una de sus subclases al configurar WebSphere DataSources de modo que se ejecuten con el controlador JDBC de Oracle10g.
[30/09/08 17:05:35:753 CEST] 00000018 WSRdbDataSour I DSRA8208I: Tipo de controlador JDBC : ""
===========================================================================================================


Thank you!
Francisco Javier Haro Rodr�guez
Greenhorn

Joined: Oct 06, 2008
Posts: 3
Excuse me, the logs are swapped.


Thanks again
Sunil dias
Greenhorn

Joined: Aug 04, 2008
Posts: 18
Hi

Did you test the database using the test button. If it works, did you configure the binding to the application which is using it (resource reference to resources).

Hope it helps

Sunil
Francisco Javier Haro Rodr�guez
Greenhorn

Joined: Oct 06, 2008
Posts: 3
Hello Sunil!

I think these are not the problems. I checked the conection and its ok. The reference to the datasource only give you flexibility but is not mandatory.

Thank you very much.


Any ideas? :-)
[ October 06, 2008: Message edited by: Francisco Javier Haro Rodr�guez ]
SreeHarsha Kotturu
Greenhorn

Joined: Dec 04, 2011
Posts: 4
please check the following progam i think it may help

package com.test;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Hashtable;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class DataSourceMainClass {

public static void main(String args[]) {

Context ctx;
try {

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
// 2810
// corbaloc:iiop:localhost:2810
// CHECK the boot strap address 2809 or not in the server ports
// corbaloc:iiop:1.0@hp-pc:2809/NameService
// hp-PCNode02
// env.put(Context.PROVIDER_URL,
// "corbaloc:iiop:1.0@hp-pc:2810/NameService");
// env.put(Context.PROVIDER_URL, "corbaloc:iiop:1.0@hp-pc:2810");

ctx = new InitialContext(env);

System.out.println(" ctx::" + ctx);

DataSource ds = (DataSource) ctx.lookup("jdbc/MyOracleXEDBJNDI");


System.out.println(" dsss::;" + ds);

Connection con = ((DataSource) ds)
.getConnection("system", "system");
System.out.println(" CON:" + con);

if (con != null) {
System.out.println(" Conn is established ");

Statement stmt = con.createStatement();

String sql = "select * from testdate";

ResultSet rs = stmt.executeQuery(sql);

while (rs.next()) {

System.out.println(" result Set::" + rs.getInt("testid"));
}

}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

/*
* STEPS TO ACCESS THE ORACLE XE CONNECTION OBJECT USING DATA SOURCE
*
* 1) LOGIN TO ADMIN CONSOLE 2) CREATE DATA SOURCE 3) CREATE DATA
* PROVIDER with a jnDi name (jdbc/MyOracleXEDBJNDI ) 4) PROVIDE THE USER ID & PASSWORD AS ALIAS NAMES
*
* 5) TEST THE CONNECTION FROM ADMIN CONSOLE 6) WRITE JAVA PROGRAM AND
* USING INITIAL LOOK UP OF WEBSPHERE URL 7) ADD
* com.ibm.ws.webservice.thinclient.jar ( from base v61 runtimes) 8) add
* rsahelpers.jar to external jars( C:program files\
* IBM\SDP\runtimes\base_v61\runtimes\lib) 9) change the scopes of
* datasource and data provider to " ALL SCOPES " 10) restart the server
* as well as scopes are changed 11) add client jar for Oracle xe data
* source ojdbc14.jar 12) get connection object by passing the userid
* and passwordas args to getconenction method.
*/

}

}
 
wood burning stoves
 
subject: WAS 6.1 JDBC problem