cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing Oracle database using Web Dynpro application

Former Member
0 Kudos

Hi Friends,

i have developed a web dynpro application which accesses oracle database.

the exact scenario is

1. i want data from Primavera system. its backend is oracle database. Primavera has its own DSN named PSDK(Primavera s/w development kit)

2. DSN is installed on the server on which im deploying my appl.

3. im writing query which goes thru this DSN and access the database

Problem:

when i deploy my application, the query gets fired for the first time. then again when i try to deploy it doesn't get the connection.

the same query i tried to run on the server itself and it is running any number of times.

i don't know what is happening exactly when im deploying the application. is the problem with the application, DSN or the server?

Can anyone please solve this problem.

Thanks n Regards

Akshay

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Akshay,

I am facing with the same issue what you had.

When i try to connect its throwing an exception as General Error. But like you mentioned, the same query i tried to run on the server itself and it is running any number of times.

Did you found a solution for this. Help me out on this issue

Thanks,

Suresh

Former Member
0 Kudos

Hi Akshay,

You have mentioned that it is not getting the conection.Is it throwing any exception.There can be a few reasons.

1. Socket error or a closed connection

2. Connection exceeding the maximum limit.

Try to print wat the function returns or catch the exception if any..

It will be easier to help then.

Regards

Bharathwaj

Former Member
0 Kudos

Are you using connection pooling ? May be the connection is getting closed due to that?

May be this link is useful

Message was edited by: Noufal Kareem

Former Member
0 Kudos

Hi Noufal,

i dont know what is exactly connection pooling. please could u elaborate on this.

im sending the code which im using for connection purpose. im calling this function evertyime i want to run a query.

public java.sql.Connection getConnection( )

{

//@@begin getConnection()

Connection conn = null;

try {

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");

conn= DriverManager.getConnection("jdbc:odbc:PrimaveraSDK_PE","admin", "admin");

}

catch (ClassNotFoundException e) {

e.printStackTrace();

}

catch (SQLException e) {

e.printStackTrace();

}

return conn;

//@@end

}

Thanks n Regards

Akshay

Former Member
0 Kudos

Hi,

Try out these variations

Global variable: private Connection conn = null;

Global variable: private int count = 0;

public java.sql.Connection getConnection( )

{

//@@begin getConnection()

try {

if(conn==null){

Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver");

conn= DriverManager.getConnection("jdbc:odbc:PrimaveraSDK_PE","admin", "admin");

count++;

//print the count here

}

}

catch (ClassNotFoundException e) {

e.printStackTrace();

}

catch (SQLException e) {

e.printStackTrace();

}

return conn;

//@@end

}

This is just to check the no of times the connection is being set to null

Regards

Noufal

Former Member
0 Kudos

Dear Akshay,

Did you resolve the issue? I am also facing the same problem. Kindly let us know if you solve this issue.

Thanks,

Regards,

Balamurugan (Bala)