cancel
Showing results for 
Search instead for 
Did you mean: 

Exception:'NetworkAdapter fails'when connecting with oracle from web dynpro

Former Member
0 Kudos

Hi,

I am trying to run one of my application in SAP netweaver Studio(webdynpro).

I want to connect to the oracle db on my local system.

I wrote the code:

Class.forName("oracle.jdbc.driver.OracleDriver");

Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:DSNname","UsrId","password");

I am getting the following error in the connection statement

Error:

java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

Oracle is 9.2.0.1.0 on windows XP platform.

I can do an SQLPLUS and the connection is ok.

I don't know were the problem is ?

Can any body help me out.

Thanks

Smitha

Accepted Solutions (1)

Accepted Solutions (1)

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

U can access ur local db like this.

try{

InitialContext initialContext = new InitialContext();

DataSource dataSource = (DataSource)initialContext.lookup("AlaisName");

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

//Do Others

}catch(Exception e){

e.printStackTrace();

}

Check this

WebDynpro and Oracle Connection

Regards,

Vijayakhanna Raman

Former Member
0 Kudos

sir,

I got connection using SQL server.

Thanks for your help.

regards Smitha

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

For the error "The Network Adapter could not establish the connection" check and do the following:

In the Computer Management - Services, check if the Oracle*TNSListener is started. If not, restart the listener and set the Startup Type to "Automatic".

Also check whether the port number in listener.ora is correct ($ORACLE_HOME\network\admin\listener.ora) and updated during the installation.

For other details run through SAP Note 786673

Hope this helps.

Regards

Srinivasan T

Former Member
0 Kudos

Sir,

Thank you very much for your immediate reply...

I checked..the Oracle*TNSListener is already started. and the Startup Type is also "Automatic".

Also I checked the port number in listener.ora :that is also same:1521

And now , again can you please help me sir...

thanks

smitha

Former Member
0 Kudos

sir,

I got connection using SQL server.

Thanks for your help.

regards Smitha