on 05-24-2005 7:51 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.