Reputation: 27
Locally everything works fine, but on a remote Weblogic not really. The next code runs without any exception.
try
{
ods = new OracleDataSource();
connectionString = XmlReader.getConnectionString();
ods.setURL(connectionString);
}
catch (SQLException ex)
{
ex.printStackTrace();
}
catch (Exception e) {
e.printStackTrace();
}
When i call getConnection() on the previous ods object, it doesnt raise any exception
try
{
if (connection == null || connection.isClosed()) {
connection = ods.getConnection();
}
}
catch(Exception e) {
e.printStackTrace();
}
But finally the connection object is null for example after calling this
CallableStatement cstmt = connection.prepareCall( jobquery );
On a database it looks like the application created the connection, but then it doesnt call the procedure specified in "jobquery". What could be wrong?
Simply my question is: Is there a way to create an OracleDataSource without an exception, and then get a null from it?
Upvotes: 0
Views: 295
Reputation: 53462
Nambaris answer will probably solve your immediate issue. Other points to consider:
These are not directly related to your problem, just things you should be doing in the long run.
Upvotes: 1
Reputation: 66637
Unless you miss some code in original question, it seems you didn't perform execute().
Example:
callableStatement.executeQuery();
Read this CallableStatement tutorial
Upvotes: 1