Interface for different cache types
This commit is contained in:
parent
a3909e2a5c
commit
491333e1ee
@ -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;
|
||||||
|
}
|
@ -11,7 +11,7 @@ import java.sql.SQLException;
|
|||||||
|
|
||||||
import static java.lang.System.identityHashCode;
|
import static java.lang.System.identityHashCode;
|
||||||
|
|
||||||
public class PreparedStatementsCompilationPhantomCache /*implements ReadOnlyProperty<Object,?>*/ {
|
public class PreparedStatementsCompilationPhantomCache implements PreparedStatementsCompilationCache {
|
||||||
@NotNull
|
@NotNull
|
||||||
private final String _statementSource;
|
private final String _statementSource;
|
||||||
@NotNull
|
@NotNull
|
||||||
@ -22,6 +22,7 @@ public class PreparedStatementsCompilationPhantomCache /*implements ReadOnlyProp
|
|||||||
this._map = new _SynchronizedEmbedKeyHashMap<>();
|
this._map = new _SynchronizedEmbedKeyHashMap<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@NotNull
|
@NotNull
|
||||||
public PreparedStatement preparedStatementForConnection(@NotNull Connection connection) throws SQLException {
|
public PreparedStatement preparedStatementForConnection(@NotNull Connection connection) throws SQLException {
|
||||||
final int key = identityHashCode(connection);
|
final int key = identityHashCode(connection);
|
||||||
|
Reference in New Issue
Block a user