cancel
Showing results for 
Search instead for 
Did you mean: 

Connect Oracle 9.2 DB to Web AS 6.40

Former Member
0 Kudos

Hello guys!

Does anybody know how to connect an oracle 9.2 db to the web as 6.40, because I am writing an WebDynpro-application, which will be used in the enterprise portal. moreover this application has to exchange data (read/write) to an oracle db.

Can anybody help me please?

I have tried to use the visual admin jdbc connector, but it doesn't work right at the moment...

thanks for your help!

best regards, patrick.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

how to create a driver in oracle...regarding the above solution?

Former Member
0 Kudos

Connect to Oracle server database from webdynpro

-


oCreate Oracle server driver in j2ee engineo Download classes12.zip (C:\Oracle\Ora81\jdbc\lib\classes12.zip) or from oracle site.

o Open Visual administrator,

/usr/sap/<instance name>/JC00/j2ee/admin/go.bat

o Navigate to server > services > JDBC connector > drivers in runtime tab

o Click create new driver and specify a name, eg "Oracle Server")

o select the classes12.zip file.

o The driver installation is now completed

Create datasource

=============

o Click DataSources in the same path as above (server > services > JDBC connector)

o Click "new driver or datasource".

o Fillout the following properties:

o Main tab > DataSource Name: fx "MyDatasource"

o Main tab > Add Alias: fx "MyAlias"

o Main tab > Driver Name: Oracle Server

o Main tab > JDBC version: 2.0 (with XA support)

o Main tab > Object factory: oracle.jdbc.pool.OracleDataSourceFactory

o Main tab > DataSource Type: ConnectionPoolDataSource

o Main tab > CPDS classname: oracle.jdbc.pool.OracleConnectionPoolDataSource

o Additional tab > add property "serverName = jdbc:oracle:thin:@localhost:1521:SID"(ur sid)

o Additional tab > add property "portNumber = 1521"

o Additional tab > add property "user = <oracle database user>, scott"

o Additional tab > add property "password = <password>",tiger

Choose Vendor SQLAdditional] SQL Engine[select ] Vendor_SQL Stop/start the J2EE Engine

restart J2EE engine

The datasource is now ready to use.Use the datasource from Web Dynproo From code the datasource can now be used by the following code snippet:

try {

InitialContext initialContext = new InitialContext();

DataSource dataSource = (DataSource)initialContext.lookup("jdbc/MyAlias");

java.sql.Connection connection = dataSource.getConnection();

}catch (SQLException e) {

// handle exception

}catch (NamingException e) {

// handle exception

}

java.sql.Statement statement = connection.createStatement();

ResultSet resultSet = statement.executeQuery("select * from tab");

System.out.println("Table Name=",+ resultSet(TNAME);

Former Member
0 Kudos

hi,

Pls view the foll thread:

Step 1. Create a new Driver

Name : ORACLE_DRIVER

Lib(s) : C:\Oracle\Ora81\jdbc\lib\classes12.zip

[Properties]

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} as in other postings.

Application Name : EtiRegisterOracle

DataSource Name : ORAJ2EDB

Aliases : none

JDBC Version : 2.0 (with XA Support)

Object Factory : oracle.jdbc.pool.OracleDataSourceFactory

DataSource Type : ConnectionPoolDataSource

CPDS Classname : oracle.jdbc.pool.OracleConnectionPoolDataSource

[Additional] Properties:

url = jdbc:oracle:thin:@localhost:1521:orcl817

user = scott

password = tiger

[Additional] SQL Engine

[x] Vendor_SQL

Step 3. Stop/start the J2EE Engine

Step 4. Browse the JNDI Repository; you should see

- jdbc - ORAJ2EDB - SAPJ2EDB

Step 5. Do the lookup and get a connection using the new DataSource (in a try/catch block of course)

// Get a connection using a DataSourceInitialContext ctx = new InitialContext();DataSource ds = (DataSource) ctx.lookup("jdbc/ORAJ2EDB");conn = ds.getConnection();conn.setAutoCommit(false);

wbr,

Krishna