Class JDBCConnection
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.sql.jdbc.JDBCConnection
-
- Direct Known Subclasses:
JDBCRowMapper
public class JDBCConnection extends Object
Holds a connection to a JDBC database.
-
-
Field Summary
Fields Modifier and Type Field Description Connection
connection
The actual connection.boolean
countExecutes
protected Dialect
dialect
The dialect.int
executeCount
JDBCLogger
logger
protected Model
model
The model used to do the mapping.protected boolean
setClientInfo
protected SQLInfo
sqlInfo
The SQL information.protected boolean
supportsBatchUpdates
-
Constructor Summary
Constructors Constructor Description JDBCConnection()
for tests onlyJDBCConnection(Model model, SQLInfo sqlInfo)
Creates a new Mapper.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkConcurrentUpdate(Throwable e)
Checks the SQL error we got and determine if a concurrent update happened.void
closeConnection()
void
connect()
protected void
countExecute()
static String
getDataSourceName(String repositoryName)
Gets the datasource to use for the given repository.Mapper.Identification
getIdentification()
String
getRepositoryName()
-
-
-
Field Detail
-
connection
public Connection connection
The actual connection.
-
supportsBatchUpdates
protected boolean supportsBatchUpdates
-
countExecutes
public boolean countExecutes
-
executeCount
public int executeCount
-
logger
public final JDBCLogger logger
-
setClientInfo
protected boolean setClientInfo
-
-
Constructor Detail
-
JDBCConnection
public JDBCConnection(Model model, SQLInfo sqlInfo)
Creates a new Mapper.- Parameters:
model
- the modelsqlInfo
- the sql info
-
JDBCConnection
public JDBCConnection()
for tests only- Since:
- 5.9.3
-
-
Method Detail
-
getRepositoryName
public String getRepositoryName()
-
getIdentification
public Mapper.Identification getIdentification()
-
countExecute
protected void countExecute()
-
getDataSourceName
public static String getDataSourceName(String repositoryName)
Gets the datasource to use for the given repository.- Since:
- 8.4
-
connect
public void connect()
-
closeConnection
public void closeConnection()
-
checkConcurrentUpdate
protected void checkConcurrentUpdate(Throwable e) throws ConcurrentUpdateException
Checks the SQL error we got and determine if a concurrent update happened. Throws if that's the case.- Parameters:
e
- the exception- Throws:
ConcurrentUpdateException
- Since:
- 5.8
-
-