Package org.datanucleus.store.rdbms
Class JDBCUtils
- java.lang.Object
-
- org.datanucleus.store.rdbms.JDBCUtils
-
public class JDBCUtils extends Object
Convenience helper for JDBC.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetSubprotocolForURL(String url)Method to return the "subprotocol" for a JDBC URL.static voidlogWarnings(ResultSet rs)Utility to log all warning for the specified ResultSet.static voidlogWarnings(SQLWarning warning)Logs SQL warnings to the common log.static voidlogWarnings(Statement stmt)Utility to log all warning for the specified Statement.
-
-
-
Method Detail
-
getSubprotocolForURL
public static String getSubprotocolForURL(String url)
Method to return the "subprotocol" for a JDBC URL. A JDBC URL is made up of jdbc:{subprotocol}:.... For example, jdbc:mysql:... or jdbc:hsqldb:....- Parameters:
url- The JDBC URL- Returns:
- The subprotocol
-
logWarnings
public static void logWarnings(SQLWarning warning)
Logs SQL warnings to the common log. Should be called after any operation on a JDBC Statement or ResultSet object.- Parameters:
warning- the value returned from getWarnings().
-
logWarnings
public static void logWarnings(Statement stmt)
Utility to log all warning for the specified Statement.- Parameters:
stmt- The statement
-
logWarnings
public static void logWarnings(ResultSet rs)
Utility to log all warning for the specified ResultSet.- Parameters:
rs- The ResultSet
-
-