File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Oracle or DB2 configuration with Websphere Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Websphere
Reply Bookmark "Oracle or DB2 configuration with Websphere" Watch "Oracle or DB2 configuration with Websphere" New topic
Author

Oracle or DB2 configuration with Websphere

aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
Hi,
I need to configure my application to use either Oracle9i database or DB2 database. I've tried doing so using only Oracle9ias. Havent succeeded as yet... :roll: Below i'm stating what all i'm doing :
1). Set up a JDBC resource provider for Oracle.
2). Made sure tht the ojdbc14.jar file is in my classpath.
3). Also the JDBC driver class name being implemented is
"oracle.jdbc.pool.OracleConnectionPoolDataSource".
4). Then i setup a datasource i.e jdbc/testOra and filled in all the
parameters as was given by the Custom Properties of the datasource.
5). The URL for Oracle i entered was :- 'jdbc racle:thin:@localhost:1521:sample'
i.e i'm using a Thin Driver.
After doing all this when i run the "Test Connection" button in the Datasource page in the Admin menu of Websphere , it gives me the following error :
Test Connection failed for datasource ChameleonDS on server server1 at node aanchal with the following exception: java.lang.Exception: java.sql.SQLException: invalid arguments in call.
On checking the log files also i didnt get any much information as to what the error is.
So if anyone can help me and tell me where i'm goin wrong it wuld help me on movin ahead with understaning websphere.
aanchal.
aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
Just to add on to what i mentioned above :
I'm using WAS 5.1 , and also my datasource is "ChameleonDS".
I did another test where in i changed the JDBC driver class name to oracle.jdbc.driver.OracleDriver
and when i ran the "TEST CONNECTION" from the datasource window i get the following error :


Test Connection failed for datasource ChameleonDS on server server1 at node aanchal with the following exception: java.lang.Exception: DSRA8101E: DataSource class cannot be used as one-phase: ClassCastException: oracle.jdbc.driver.OracleDriver
Edy Yu
Ranch Hand

Joined: Nov 21, 2000
Posts: 264
Did you set the authentication alias?
Unlike WebSphere 4.0, WebSphere v 5.0 datasource uses JAAS on datasource.
Can I consider the new 5.0 datasource a instance of JCA


<i><br />Sun Certified Programmer for Java 2 Platform (SCJP)<br />Sun Certified Developer for Java 2 Platform (SCJD)<br />Sun Certified Web Component Developer for Java2 Platform, Enterprise Edition (SCWCD)<br />Sun Certified Business Component Developer for Java2 Platform, Enterprise Edition (SCBCD)<br />Sun Certified Enterprise Architect for J2EE (SCEA)<br />IBM Certified Enterprise Developer, WebSphere Studio V5.0<br /></i>
aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
Hi Edy,
Thanx for a quick Response. i'm a complete newbie with WAS so you will have to give me more details about what i'm doing wrong.
I checked the Authentication Alias on the Page for the Datasource which i created . There were 2 options there as follows :
Component-managed Authentication Alias : have options as follows -->
1). none
2). aanchal/samples
3). aanchal/psAlias
And the other option is
Container-managed Authentication Alias : having following options -->
1). none
2). aanchal/samples
3). aanchal/psAlias
In both cases i have "None" selected. So not sure whats missing and what i should be doin. Please let me know in detail so i can solve the problem and hopefully move on .
thanx
aanchal.
aanchal mathur
Greenhorn

Joined: Sep 13, 2001
Posts: 29
yipeee
thanx Edy i finally figured out why it was giving me that error. But no i'm gettin the error "Invalid username/password". I created 2 properties in the Custom properties where in i entered the username and password as the 2 properties. But still i was getting "Invalid username/password".
I couldnt understand the "Mapping-Configuration Alias" . Each time i would set it to null and it would still defualt it to "defualtPrinicipalMapping".
Wasnt sure whats to be done there. If you could tell me i'd move 1 step ahead .
thanx
aanchal.
Rufus BugleWeed
Ranch Hand

Joined: Feb 22, 2002
Posts: 1551
You are new to J2EE too?
Have you seen this page?
Edy Yu
Ranch Hand

Joined: Nov 21, 2000
Posts: 264
In your WSAD WebSphere Test Enviroment configuration, under security pane, add your username/password as one JAAS authentication entry. Give it an alias name. Use that alias in your datasource setting.
In WebSphere server, there is similar pages for this task ...
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Oracle or DB2 configuration with Websphere
 
Similar Threads
Not able to config the database!
Class not found exception while creating datasource
db2 connectivity
Websphere 5.1 with db2 v7.2 FP 11
java.sql.SQLException: No suitable driver