Package org.apache.torque.adapter
Klasse MysqlAdapter
java.lang.Object
org.apache.torque.adapter.AbstractAdapter
org.apache.torque.adapter.MysqlAdapter
- Alle implementierten Schnittstellen:
Serializable
,Adapter
This is used in order to connect to a MySQL database using the MM
drivers. Simply comment the above and uncomment this code below and
fill in the appropriate values for DB_NAME, DB_HOST, DB_USER,
DB_PASS.
"jdbc:mysql://" + DB_HOST + "/" + DB_NAME + "?user=" + DB_USER + "&password=" + DB_PASS;
- Version:
- $Id: MysqlAdapter.java 1850965 2019-01-10 17:21:29Z painter $
- Autor:
- Jon S. Stevens, Brett McLaughlin, Daniel Rall
- Siehe auch:
-
Feldübersicht
Von Schnittstelle geerbte Felder org.apache.torque.adapter.Adapter
ADAPTER_KEY, AUTODETECT_ADAPTER, DRIVER_KEY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
generateLimits
(Query query, long offset, int limit) Generate a LIMIT offset, limit clause if offset > 0 or an LIMIT limit clause if limit is > 0 and offset is 0.getIDMethodSQL
(Object obj) Returns the SQL to get the database key of the last row inserted, which in this case isSELECT LAST_INSERT_ID()
.Returns the constant from theIDMethod
interface denoting which type of primary key generation method this type of RDBMS uses.ignoreCase
(String in) This method is used to ignore case.void
lockTable
(Connection con, String table) Locks the specified table.toUpperCase
(String in) This method is used to ignore case.void
unlockTable
(Connection con, String table) Unlocks the specified table.Von Klasse geerbte Methoden org.apache.torque.adapter.AbstractAdapter
escapeText, getStringDelimiter, getUpdateLockClause, ignoreCaseInOrderBy, setCapabilities, supportsNativeLimit, supportsNativeOffset, useEscapeClauseForLike, useGetGeneratedKeys, useIlike, useMinusForExcept
-
Konstruktordetails
-
MysqlAdapter
protected MysqlAdapter()Empty protected constructor.
-
-
Methodendetails
-
toUpperCase
This method is used to ignore case.- Angegeben von:
toUpperCase
in SchnittstelleAdapter
- Angegeben von:
toUpperCase
in KlasseAbstractAdapter
- Parameter:
in
- The string to transform to upper case.- Gibt zurück:
- The upper case string.
-
ignoreCase
This method is used to ignore case.- Angegeben von:
ignoreCase
in SchnittstelleAdapter
- Angegeben von:
ignoreCase
in KlasseAbstractAdapter
- Parameter:
in
- The string whose case to ignore.- Gibt zurück:
- The string in a case that can be ignored.
-
getIDMethodType
Beschreibung aus Klasse kopiert:AbstractAdapter
Returns the constant from theIDMethod
interface denoting which type of primary key generation method this type of RDBMS uses.- Angegeben von:
getIDMethodType
in SchnittstelleAdapter
- Angegeben von:
getIDMethodType
in KlasseAbstractAdapter
- Gibt zurück:
- IDMethod constant
- Siehe auch:
-
getIDMethodSQL
Returns the SQL to get the database key of the last row inserted, which in this case isSELECT LAST_INSERT_ID()
.- Angegeben von:
getIDMethodSQL
in SchnittstelleAdapter
- Angegeben von:
getIDMethodSQL
in KlasseAbstractAdapter
- Parameter:
obj
- Information used for key generation.- Gibt zurück:
- The most recently inserted database key.
- Siehe auch:
-
lockTable
Locks the specified table.- Angegeben von:
lockTable
in SchnittstelleAdapter
- Angegeben von:
lockTable
in KlasseAbstractAdapter
- Parameter:
con
- The JDBC connection to use.table
- The name of the table to lock.- Löst aus:
SQLException
- No Statement could be created or executed.
-
unlockTable
Unlocks the specified table.- Angegeben von:
unlockTable
in SchnittstelleAdapter
- Angegeben von:
unlockTable
in KlasseAbstractAdapter
- Parameter:
con
- The JDBC connection to use.table
- The name of the table to unlock.- Löst aus:
SQLException
- No Statement could be created or executed.
-
generateLimits
Generate a LIMIT offset, limit clause if offset > 0 or an LIMIT limit clause if limit is > 0 and offset is 0.- Angegeben von:
generateLimits
in SchnittstelleAdapter
- Setzt außer Kraft:
generateLimits
in KlasseAbstractAdapter
- Parameter:
query
- The query to modifyoffset
- the offset Valuelimit
- the limit Value
-