Reputation: 7376
I want to oracle dabase connection with java. I use this code :
url = statement;
try {
stmt = connection.createStatement();
rset = stmt.executeQuery(url);
} catch (Exception e) {
// what can I put here?
}
And when my statement cause error in oracle I want to get error message. How can i do this?
Upvotes: 1
Views: 9794
Reputation: 404
A simple Google search reveals:
JDBC Exception handling is very similar to Java Excpetion handling but for JDBC, the most common exception you'll deal with is java.sql.SQLException.
Check out their example here
Good Luck!
Upvotes: 1