on 07-29-2008 11:44 AM
Hi all,
When I work on a local project and add classes12.jar to lib folder, I connect successfully to DB and extract data.
However, I tried to use WD DC project, and for this I've created external lib,added the same jar file and added it to WD DC as used DC.
But here I'm getting error: "No suitable driver"
I'm getting the same error also when I'm not use the external DC.
I guess I'm doing something wrong.
Does anyone has idea what I need to do in order to solve this problem?
Thanks
Ami
Hi Amy:
Configure your DB at Visual Administrator to avoid Hardcode:
Open Visual Administrator --> JDBC connector
Step 1. Create a new Driver or use an existing one
Name: ORACLE_DRIVER_JDBC
Lib(s): classes111.jar
SQLEngine = Vendor_SQL
Step 2. Create a new DataSource
NOTE: the property names are case-sensitive and you must use {url, user, password} and not {URL, User, Password}.
DataSource Name :
JDBC Version : 2.0 (with XA Support)
Object Factory : oracle.jdbc.pool.OracleDataSourceFactory
DataSource Type : ConnectionPoolDataSource
CPDS Classname : oracle.jdbc.pool.OracleConnectionPoolDataSource
url = jdbc:oracle:thin:@ +
Step 3. Stop/start the J2EE Engine
In your code:
InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource)initialContext.lookup("jdbc/< define Alias>");
//Create a connection to the database
if (connection ==null){
connection = dataSource.getConnection();
}
Hope it helps you
Rocío.
Edited by: Rocío Lorena Suárez on Sep 11, 2008 5:32 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Have you pasted the oracle driver in the correct path?
Regards
Ayyapparaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Ayyapparaj for your reply.
I added the oracle driver as described in SAP documentation:
Link: http://help.sap.com/saphelp_nw70/helpdata/en/46/2899fb035d4f07e10000000a114a6b/frameset.htm
what do you mean by correct path?
Thanks
Ami
Hi ami,
Oracle driver should be following syntax. check in your code.
For Oracle the JDBC connection URL syntax is:
- jdbc:<protocol>:<subprotocol>:<username>/<password>@<host>:<port>:<sid>
where
<protocol> = oracle
<subprotocol> = thin (this is the Oracle pure Java driver that is portable)
<username> = the database account name to use when establishing a connection
<password> = the password of the account name to use when establishing a connection
<host> = the fully qualified domain name or IP address of the database machine
<port> = the port the machine is listening for connections on (TNS Listener)
<sid> = the database name/instance to connect to
For Example:
jdbc:oracle:thin:system/manager_server1.sample:1521:sdn
Regards,
P.Manivannan
Thnaks P.Manivannan for reply.
I'll explain my situation better,
I've imported the local WD project (That is already working fine) to WD DC, so the code is the same, its working fine in local project.
the problems begins within the DC project. I guess its related to appropriate configuration (extreanl library with the jar file),
even though I've done this I guess I'm still missing something.
Any idea will be appriciated.
Thanks
Ami
Hi ami,
Directly connect oracle in WD is not a advisable.better u connect the oracle via EJB.
According to MVC architecture all business logic will be implemented into the EJB part then u can get into the EJB reference(sap.com/<your ear file name without extension>)
after getting the reference from EJB(ear file) then only that "suitable driver" exception will be removed
you can refer the following link
https://wiki.sdn.sap.com/wiki/display/WDJava/OracleConnectivitywithEJBusingWebDynproApplication
Regards,
P.Manivannan
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.