on 09-20-2007 10:08 PM
Hi Experts,
I am the beginer in sap, could any one help to how to check the connection between java and oracle database in sap?
I need the command the command to check the connection .
regards
Ken
Hi
with the following code if you get SOP as
<b>Connection is : null</b>you have not achieved connection
Connection con=null;
try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
con =DriverManager.getConnection("jdbc:oracle:thin:@<servername>:<portnumber>:DB","uname", "pwd");
System.out.println("Connection is : "+ con);
}
catch(SQLException sqe)
{
System.out.println("SQLException ............."+sqe);
}
catch(Exception ex)
{
System.out.println("GeneralException ............."+ex);
}
finally
{
try
{
conn.close(); // closing the connection
}
catch(Exception e)
{
System.out.println("Error");
}
}
<b>You can go through the following link for more details</b><a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/wiki?path=/pages/viewpage.action&pageid=47055">wiki</a>
Regards
Abhijith YS
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ken,
Kindly post in more details, what yuou want to achieve.
If it is thru programming that u want to check if connection is alive, there is a method named disconnectIfAlive(), that acts on a model name.
regds,
Sukanta Rudra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.