Class Database
java.lang.Object
com.storedobject.core.Database
com.storedobject.database.postgres.Database
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanalterPassword(String user, String oldPassword, String newPassword) Change the password of the user on the SQL connection.Get the SQL statement string to call the stored procedure.columnType(String columnType, int width, int precision) booleancreateLogin(String user, String password) Creates a login with the given login name and password.protected String[]createSchemaDDL(String schemaName) The SQL column that can bring the current time from the database.databaseSQL(String databaseName) Part of the SQL string (starting with FROM) that can query details of a database.protected StringdropDatabaseDDL(String databaseName) booleanDrops a login with the given login name and password.Get the name of the Object class of this database.getSerial(int tag) Get the SQL statement for generating the next Id for the tag passed.booleanCheck if the username passed is a valid login of the SQL connection passed.booleanChecks if the username and password are correct in the current database.The name of the model database.name()The name of the driver.parentTable(String tableName) protected booleanresetPassword(String user, String securityPassword, String newPassword) Reset the password of the user, given the security password.userSQL()The SQL string that can return the login name of the current user as a column value.Methods inherited from class com.storedobject.core.Database
changePassword, columnDetails, createDatabase, createDatabaseDDL, createSchema, createTable, currentTimeSQL, databaseExists, dependentConstraints, dropDatabase, ensureMaster, executeSQL, executeSQL, executeSQL, executeSQL, executeSQL, foreignKeyConstraintNames, foreignKeyConstraints, format, formatWithTime, get, getCurrentTime, getSQL, initialPassword, isMaster, lockDatabase, login, maxTime, maxTimeStamp, nanoDigits, schemaExists, securityLogin, tableExists, validateSecurityPassword, viewExists
-
Constructor Details
-
Database
public Database()
-
-
Method Details
-
name
-
modelDatabase
Description copied from class:DatabaseThe name of the model database. Such a concept is there in some database systems.- Specified by:
modelDatabasein classDatabase- Returns:
- The name of the model database. Null string may be returned if such a concept does not exist.
-
userSQL
-
databaseSQL
Description copied from class:DatabasePart of the SQL string (starting with FROM) that can query details of a database.- Specified by:
databaseSQLin classDatabase- Parameters:
databaseName- Database name.- Returns:
- Part of the SQL string.
-
isALogin
Description copied from class:DatabaseCheck if the username passed is a valid login of the SQL connection passed. -
isALogin
Description copied from class:DatabaseChecks if the username and password are correct in the current database. -
createLogin
Description copied from class:DatabaseCreates a login with the given login name and password.- Specified by:
createLoginin classDatabase- Parameters:
user- The login name.password- The security password.- Returns:
- True if successfully created.
-
dropLogin
-
alterPassword
Description copied from class:DatabaseChange the password of the user on the SQL connection.- Specified by:
alterPasswordin classDatabase- Parameters:
user- The login name whose password needs to be changed.oldPassword- Old password.newPassword- New password.- Returns:
- True if the password is successfully changed.
-
resetPassword
Description copied from class:DatabaseReset the password of the user, given the security password.- Specified by:
resetPasswordin classDatabase- Parameters:
user- The login name whose password needs to be changed.securityPassword- The security superuser's passwordnewPassword- The password for the user.- Returns:
- True if the password is successfully changed.
-
currentTime
Description copied from class:DatabaseThe SQL column that can bring the current time from the database. For example, in the case of Sybase Adaptive Server Enterprise, it will return "getdate()".- Specified by:
currentTimein classDatabase- Returns:
- The SQL column that can bring the current time from the database.
-
getSerial
-
callProc
Description copied from class:DatabaseGet the SQL statement string to call the stored procedure. For example, in the case of Sybase Adaptive Server Enterprise, if a procedure called "AuthorizeTran" needs to be invoked with parameters "25, 345, 23", this method will return "EXEC AuthorizeTran 25, 345, 23". -
columnType
- Specified by:
columnTypein classDatabase
-
dropDatabaseDDL
- Specified by:
dropDatabaseDDLin classDatabase
-
createSchemaDDL
- Specified by:
createSchemaDDLin classDatabase
-
getObjectClassName
Description copied from class:DatabaseGet the name of the Object class of this database.- Specified by:
getObjectClassNamein classDatabase- Returns:
- Full name of the class
-
parentTable
- Specified by:
parentTablein classDatabase
-