diff --git a/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationCache.java b/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationCache.java new file mode 100644 index 0000000..7f6c836 --- /dev/null +++ b/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationCache.java @@ -0,0 +1,12 @@ +package ru.langrafhomyak.db.jdbc_resources_manager; + +import org.jetbrains.annotations.NotNull; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.SQLException; + +public interface PreparedStatementsCompilationCache { + @NotNull + PreparedStatement preparedStatementForConnection(@NotNull Connection connection) throws SQLException; +} diff --git a/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationPhantomCache.java b/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationPhantomCache.java index 28a7301..0f9a617 100644 --- a/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationPhantomCache.java +++ b/src/jvmMain/java/ru/langrafhomyak/db/jdbc_resources_manager/PreparedStatementsCompilationPhantomCache.java @@ -11,7 +11,7 @@ import java.sql.SQLException; import static java.lang.System.identityHashCode; -public class PreparedStatementsCompilationPhantomCache /*implements ReadOnlyProperty*/ { +public class PreparedStatementsCompilationPhantomCache implements PreparedStatementsCompilationCache { @NotNull private final String _statementSource; @NotNull @@ -22,6 +22,7 @@ public class PreparedStatementsCompilationPhantomCache /*implements ReadOnlyProp this._map = new _SynchronizedEmbedKeyHashMap<>(); } + @Override @NotNull public PreparedStatement preparedStatementForConnection(@NotNull Connection connection) throws SQLException { final int key = identityHashCode(connection);