on 08-14-2006 5:57 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.