Oracle Usage Summary
1. New Table Delete Table
New Table statement:
CREATE table + table name {
}
CREATE TABLE Afa_user (user_id VARCHAR2 ( +) notNULL, tenant_id VARCHAR2 ( +), User_code VARCHAR2 ( +), PASSWORD VARCHAR2 ( +), user_name VARCHAR2 ( -), User_type VARCHAR2 ( -), Identity_code VARCHAR2 ( -), invlidate date, --//time type: 2017/7/28 auth_mode VARCHAR2 ( -), STATUS VARCHAR2 ( -), Unlock_time TIMESTAMP, Menu_style VARCHAR2 ( -), Menu_role VARCHAR2 ( -), Lastest_login TIMESTAMP,--//timestamp type: August-May-17 12.57.09.000000 pm error_count INTEGER , --//integer start_date date, end_date date, mac_address VARCHAR2 ( -), IP_Address VARCHAR2 ( -), Mobile_no VARCHAR2 ( the), EMAIL VARCHAR2 ( +), Major_usercode VARCHAR2 ( +), Major_username VARCHAR2 ( -), Main_orgid VARCHAR2 ( +), Main_positionid VARCHAR2 ( +), Create_user VARCHAR2 ( +), Create_time TIMESTAMP,
Last_modify_time number, --//timestamp common type, the entity is stored with a long, saving the new Date (). GetTime () Milliseconds of time constraint Pk_afa_user pri Mary Key (USER_ID)--//Set Primary key ); Comment on table Afa_userIs ---//Set Note information 'User Information Table'; Comment on column afa_user. USER_ID is'User ID'; Comment on column afa_user. tenant_id is'Tenant ID'; Comment on column afa_user. User_code is'User Account'; Comment on column afa_user. PASSWORD is'User Password'; Comment on column afa_user. User_name is'User name'; Comment on column afa_user. User_type is'user Type (admin)'; Comment on column afa_user. Identity_code is'User ID number'; Comment on column afa_user. Invlidate is'Password Expiration Date'; Comment on column afa_user. Auth_mode is'local password Authentication, LDAP authentication, etc.'; Comment on column afa_user. STATUS is'Normal, Pending, logout, Locked'; Comment on column afa_user. Unlock_time is'When the status is locked, the time to unlock'; Comment on column afa_user. Menu_style is'Menu Style'; Comment on column afa_user. Lastest_login is'Last logon time'; Comment on column afa_user. Error_count is'number of password errors'; Comment on column afa_user. Start_date is'User Effective Date'; Comment on column afa_user. End_date is'User Expiration Date'; Comment on column afa_user. Mac_address is'allow multiple MAC addresses to be set'; Comment on column afa_user. IP_Address is'allow multiple IP addresses to be set'; Comment on column afa_user. Mobile_no is'Mobile phone number'; Comment on column afa_user. EMAIL is'Email Address'; Comment on column afa_user. Major_usercode is'Direct Supervisor'; Comment on column afa_user. Major_username is'Supervisor Name'; Comment on column afa_user. Main_orgid is'affiliated (main) institutions'; Comment on column afa_user. Main_positionid is'affiliated (main) Post'; Comment on column afa_user. Create_user is'Create Person'; Comment on column afa_user. Create_time is'creation Time';
To delete a table:
DROP TABLE Table Cascade constraints
DROP TABLE afa_user cascade constraints;
2. Update table field
New fields:
ALTER TABLE afa_user ADD last_modify_time number;
To modify a field:
ALTER TABLE afa_user MODIFY last_modify_time number;
To delete a field:
ALTER TABLE afa_user DROP COLUMN last_modify_time;
3. Update TIMESTAMP statement
set create_time=to_timestamp (To_char (sysdate,'yyyy-mm-dd hh24:mi:ss'),' yyyy-mm-dd hh24:mi:ss.ff');
4. Oracle Connection Configuration
jdbc.url=jdbc:oracle:thin:@192.168. 10.222:1521: orcljdbc.username=Gams0502jdbc.password=bsjdbc.maxactive =
MyBatis Usage Summary
1. New Table Delete Table
New Table statement:
CREATE table + table name {
}
CREATE TABLE Afa_user
(
user_id varchar (+) NOT null comment ' user ID ', non-empty comment
tenant_id varchar (+) Comment ' tenant ID ',
User_code varchar (+) Comment ' user account ',
PASSWORD varchar (+) Comment ' user password ',
User_name varchar (comment ' user name '),
User_type varchar (comment) ' User type (admin) ',
Identity_code varchar (comment ' User ID number '),
invlidate datetime comment ' Password expiration date ',
Auth_mode varchar (comment ' Local password authentication, LDAP authentication, etc. '),
STATUS varchar (comment) ' Normal, hang, logout, lock ',
Unlock_time timestamp comment ' When the state is locked, unlock the time ',
Menu_style varchar (Comment ' menu style '),
Menu_role varchar Comment ' menu style character ',
Lastest_login Timestamp comment ' Recent login time ',
error_count int comment ' Password error number ',
start_date datetime comment ' user valid date ',
end_date datetime comment ' User expiration date ',
mac_address varchar (+) Comment ' Allow multiple MAC addresses to be set ',
IP_Address varchar (+) Comment ' Allow multiple IP addresses to be set ',
Mobile_no varchar (comment ' mobile number '),
Email varchar (+) Comment ' Email address ',
Major_usercode varchar (+) Comment ' Direct supervisor ',
Major_username varchar Comment ' Supervisor name ',
Main_orgid varchar (+) Comment ' owned (main) institution ',
Main_positionid varchar (+) Comment ' owned (main) post ',
Create_user varchar (+) Comment ' creator ',
Create_time Timestamp comment ' creation time ',//timestamp type
Primary KEY (USER_ID)//Set Primary key information
);
ALTER TABLE Afa_user Comment ' User Information table '; Note Table name
To delete a table:
drop table if Existes tables name
drop table if exists afa_user;
2. Update table field
New fields:
ALTER TABLE afa_user ADD last_modify_time number;
To modify a field:
ALTER TABLE afa_user MODIFY last_modify_time number;
To delete a field:
ALTER TABLE afa_user DROP COLUMN last_modify_time;
3. Update TIMESTAMP statement
Update Afa_user Set Create_time=to_timestamp (To_char (sysdate, ' yyyy-mm-dd hh24:mi:ss '), ' yyyy-mm-dd hh24:mi:ss.ff ');
4. MyBatis Connection Configuration
Jdbc.url=jdbc:mysql://127.0.0.1:3306/appframe?prepstmtcachesize=517&cacheprepstmts=true& autoreconnect=true&characterencoding=utf-8&zerodatetimebehavior=converttonull&allowmultiqueries= Truejdbc.username=rootjdbc.password=123456jdbc.maxactive=
MyBatis and Oracle Usage Summary