OPSC: Catching the ``Oops'' in JDBC PreparedStatements with Static Code Analysis
We introduce the Optional Prepared Statement Checker (OPSC, "OOP-see"), a novel type checker designed to identify errors in the use of JDBC. OPSC bridges the gap between SQL and Java types by statically verifying that the correct Java types are used when sending input parameters or retrieving results from a database. This allows OPSC to detect type mismatches at compile time, preventing issues that might otherwise surface as runtime errors in production. Unlike the Java compiler, which is limited to checking Java code, OPSC can also uncover issues not detectable by existing tools. Our early prototype successfully checks JDBC code across multiple Java projects from textbooks, identifying type mismatches that other state-of-the-art tools cannot detect.
Publication Details
- Journal
- Gesellschaft für Informatik (GI)
- Published
- 2025-01-01
- DOI
- https://doi.org/10.18420/btw2025-64
- Primary Topic
- Logic, programming, and type systems
- Type
- article
- Field-Weighted Citation Impact
- 0.00