on 09-06-2006 3:54 PM
Hello all,
I am developing a webdynpro application which accesses a set of database tables. These tables were created using Java Dictionary and has been successfully deployed. I have the data-sources-aliases.xml file in the META-INF folder. <?xml version .... <data-source-name>${com.sap.datasource.default}</data-source-name><alias>SIA_DS</alias> ... </data-source-aliases>
But when I try to get a db connection, the app returns with the below error.
Method getConnection() is not supported by Open JDBC
I am using
InitialContext context = new InitialContext();
DataSource ds = (DataSource) context.lookup("jdbc/SIA_DS");
return ds.getConnection();
to get a connection.
How do I fix this? Is there something else I am missing?. Thanks
Raj Balakrishnan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I fixed it on my own. Just to let you know what happened.
I had a method to close the connection as below
protected static void closeDbResourcesQuietly(Statement stmt) {
if (stmt != null) {
try {
Connection con = stmt.getConnection();
stmt.close();
closeDbResourcesQuietly(con);
} catch (SQLException e) {
// Donot report since it is a quiet method e.printStackTrace();
}
}
}
Apparently in OpenJDBC, the statement stmt.getConnection() is not supported. I commented out that and it worked fine.
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 | |
7 | |
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.