Instruction file imported from saivenkat999/TestRepoCopilot (
.github/instructions/shared/jdbc/jdbc-java-checklist.instructions.md). Copyright stays with the author.
JDBC Java Development Guidelines
Java coding standards for the Progress DataDirect JDBC driver codebase.
Accepted Patterns (do not flag these)
synchronizer = connection— all child objects lock on parent Connection. Intentional.Class.forName/Method.invoke— Spy layer decoupling, JDBC 4.0 fallback. Intentional.finalize()in BaseConnection/BaseStatement — legacy safety net. Do not add new ones.Spy*classes delegating every method with try/catch/log — diagnostic layer, not dead code.catch (SQLException se) { //toss }incommonCloseReset()— rollback fail on close is non-fatal.
Review Focus
- Unsupported methods must use
BaseExceptions.getException(BaseLocalMessages.METHOD_NOT_SUPPORTED, ...)— rawSQLFeatureNotSupportedExceptiononly forgetParentLogger() - Every
getXxx()must setlastGetWasNull = field.isNull()after data access - Check
impl* == nullat method entry → throwERR_OBJECT_CLOSED - Close children before parents:
rs.close()thenstmt.close() - No try-with-resources in production — use explicit try/finally
- New catch blocks must not be empty — log or rethrow
- Create exceptions via
BaseExceptions.getException()— nevernew SQLException()directly DECIMAL/NUMERIC→BigDecimalwithRoundingMode.HALF_UP- No
java.time— usejava.sql.Date/Time/BaseTimestamp - Synchronize on
synchronizerin Statement/ResultSet/Blob/Clob methods - Mark timeout/cancel fields
volatile - Never log passwords — emit
"********" - Copyright header on every new file
- Java 8 only — no var, records, sealed classes, modules
- Javadoc:
@param,@return,@throwson public API methods