Class PreparedStatementWrapper
- java.lang.Object
-
- org.linuxforhealth.fhir.persistence.params.database.PreparedStatementWrapper
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class PreparedStatementWrapper extends java.lang.Object implements java.lang.AutoCloseable
Wraps aPreparedStatement
together with the statement text for easier logging when there are errors
-
-
Constructor Summary
Constructors Constructor Description PreparedStatementWrapper(java.lang.String statementText, java.sql.PreparedStatement ps)
Canonical constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.sql.ResultSet
executeQuery()
Convenience method to delegate the call to the wrapped statementjava.sql.PreparedStatement
getPreparedStatement()
java.lang.String
getStatementText()
-
-
-
Method Detail
-
getStatementText
public java.lang.String getStatementText()
- Returns:
- the statementText
-
getPreparedStatement
public java.sql.PreparedStatement getPreparedStatement()
- Returns:
- the preparedStatement
-
close
public void close() throws java.sql.SQLException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Throws:
java.sql.SQLException
-
executeQuery
public java.sql.ResultSet executeQuery() throws java.sql.SQLException
Convenience method to delegate the call to the wrapped statement- Returns:
- Throws:
java.sql.SQLException
-
-