Class SqlPlatform
java.lang.Object
com.codename1.db.sql.SqlPlatform
- Direct Known Subclasses:
BackendSqlPlatform
What the wire clients need from the target they run on: a socket, random bytes, and the exceptions a caller catches.
The backend and an application each install one before the first connection; the wire clients never name either side's classes, which is what lets one copy of them serve both.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconcurrencyFailure(String message) The exception for a transaction that can be run again.abstract SqlSocketOpens a plain TCP connection.static SqlPlatformget()The installed platform.static voidinstall(SqlPlatform platform) Makesplatformthe one every connection opened from now on uses.integrityViolation(String message) The exception for a write a constraint refused.byte[]abstract byte[]randomBytes(int length) lengthbytes from a cryptographically secure source.withMessage(IOException failure, String message) failureagain withmessage, keeping what kind of failure it is.
-
Constructor Details
-
SqlPlatform
public SqlPlatform()
-
-
Method Details
-
install
Makesplatformthe one every connection opened from now on uses. -
get
The installed platform.
Throws
IllegalStateException: when none is installed, which is a defect in the target, not something a caller recovers from
-
connect
Opens a plain TCP connection.- Throws:
IOException
-
randomBytes
lengthbytes from a cryptographically secure source.- Throws:
IOException
-
concurrencyFailure
The exception for a transaction that can be run again. -
integrityViolation
The exception for a write a constraint refused. -
withMessage
failureagain withmessage, keeping what kind of failure it is. -
pbkdf2
public byte[] pbkdf2(String digest, byte[] password, byte[] salt, int iterations, int length) throws IOException - Throws:
IOException
-