MYBATIS Quick Guide
int(10) NOT NULL AUTO_INCREMENT, NAME varchar(100) NOT NULL, BRANCH varchar(255) NOT NULL, PERCENTAGE int(3) NOT NULL, PHONE int(10) NOT NULL, EMAIL varchar(255) NOT NULL, PRIMARY -> ID int(10) NOT NULL AUTO_INCREMENT, -> NAME varchar(100) NOT NULL, -> BRANCH varchar(255) NOT NULL, -> PERCENTAGE int(3) NOT NULL, -> PHONE int(11) NOT NULL, -> EMAIL varchar(255) varchar(255) NOT NULL, -> PRIMARY KEY (`ID`) -> ); Query OK, 0 rows affected (0.37 sec) Student POJO Class Create a STUDENT class in STUDENT.java file as public class Student { private int id;0 码力 | 34 页 | 301.72 KB | 1 年前3传智播客 mybatis 框架课程讲义
Public static void main(String[] args) { Connection connection = null; PreparedStatement preparedStatement = null; ResultSet resultSet = null; try { //加载数据库驱动 Class.forName("com.mysql.jdbc.Driver"); //通过驱动管理类获取数据库链接 }finally{ //释放资源 if(resultSet!=null){ try { resultSet.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if(preparedStatement!=null){ try { preparedStatement catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } } if(connection!=null){ try { connection.close(); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace();0 码力 | 75 页 | 1.16 MB | 1 年前3Mybatis 3.3.0 中文用户指南
REUSE BATCH SIMPLE defaultStatementTimeout 设置超时时间,它 决定驱动等待数据 库响应的秒数。 Any positive integer Not Set (null) safeRowBoundsEnabled 允许在嵌套语句中 使用分页 (RowBounds)。 true | false False mapUnderscoreToCamelCase 是否开启自动驼峰 特定的 JDBC 类型 时,为空值指定 JDBC 类型。 某些 驱动需要指定列的 JDBC 类型,多数情 况直接用一般类型 即可,比如 NULL、 VARCHAR 或 OTHER。 JdbcType enumeration. Most common are: NULL, VARCHAR and OTHER OTHER lazyLoadTriggerMethods 指定哪个对象的方 法触发一次延迟加 XMLDynamicLanguageDriver callSettersOnNulls 指定当结果集中值 为 null 的时候是否 调用映射对象的 setter(map 对象 时为 put)方法,这 对于有 Map.keySet() 依赖 或 null 值初始化的 时候是有用的。注 意基本类型(int、 boolean等)是不 能设置成 null 的。 true | false false logPrefix 指定 MyBatis0 码力 | 98 页 | 2.03 MB | 1 年前3Apache ShardingSphere 5.2.0 Document
StaticReadwriteSplittingStrategyConfiguration("demo_write_ds", Arrays.asList("demo_read_ds_0", "demo_read_ds_1")), null,"demo_ weight_lb"); Properties algorithmProps = new Properties(); algorithmProps.setProperty("demo_read_ds_0" Arrays.asList(createDatabaseDiscoveryConfiguration(), createReadwriteSplittingConfiguration()), null); private static DatabaseDiscoveryRuleConfiguration createDatabaseDiscoveryConfiguration() { D "name_ encryptor", null); EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_ encryptor", null); EncryptTableRuleConfiguration0 码力 | 483 页 | 4.27 MB | 1 年前3Apache ShardingSphere 5.4.1 Document
source is used when executing CREATE TABLE statement to create a single table. The default value is null, indicating random unicast routing. Related References • Single Table Algorithm Sharding shardingAlgorithms: `undo_log` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'increment id', `branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id', `xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id' `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense0 码力 | 572 页 | 3.73 MB | 1 年前3Apache ShardingSphere 5.2.1 Document
StaticReadwriteSplittingStrategyConfiguration("demo_write_ds", Arrays.asList("demo_read_ds_0", "demo_read_ds_1")), null,"demo_ weight_lb"); Properties algorithmProps = new Properties(); algorithmProps.setProperty("demo_read_ds_0" Arrays.asList(createDatabaseDiscoveryConfiguration(), createReadwriteSplittingConfiguration()), null); private static DatabaseDiscoveryRuleConfiguration createDatabaseDiscoveryConfiguration() { D "name_ encryptor", null); EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_ encryptor", null); EncryptTableRuleConfiguration0 码力 | 523 页 | 4.51 MB | 1 年前3Apache ShardingSphere v5.5.0 document
source is used when executing CREATE TABLE statement to create a single table. The default value is null, indicating random unicast routing. Related References • Single Table SQL Federation Background :config.yaml?placeholder- type=system_props"); try { assert null == System.getProperty("fixture.config.driver.jdbc-url"); assert null == System.getProperty("fixture.config.driver.username"); System `undo_log` ( `branch_id` BIGINT NOT NULL COMMENT 'branch transaction id', `xid` VARCHAR(128) NOT NULL COMMENT 'global transaction id', `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as0 码力 | 602 页 | 3.85 MB | 1 年前3MyBatis 框架尚硅谷 java 研究院版本:V 1.0
如果没有配置 databaseIdProvider 标签,那么 databaseId=null 2 如果配置了 databaseIdProvider 标签,使用标签配置的 name 去匹配数据库信息, 匹配上设置 databaseId=配置指定的值,否则依旧为 null 3 如果 databaseId 不为 null,他只会找到配置 databaseId 的 sql 语句 4 MyBatis 会加载不带 getNamedParams(Object[] args) { final int paramCount = names.size(); if (args == null || paramCount == 0) { return null; } else if (!hasParamAnnotation && paramCount == 1) { return args[names.firstKey()]; insert into orcl_employee(id,last_name,email,gender) values(employee_seq.nextval,#{lastName, ,jdbcType=NULL },#{email},#{ge nder}) JAVAEE 课程系列 ————————————————————————————— 20 更多 Java –大数据 –前端 –python 人工智能资料下载,可访问百度:尚硅谷官网0 码力 | 44 页 | 926.54 KB | 1 年前3Apache ShardingSphere 中文文档 5.4.1
`undo_log` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT 'increment id', `branch_id` BIGINT(20) NOT NULL COMMENT 'branch transaction id', `xid` VARCHAR(100) NOT NULL COMMENT 'global transaction id' `context` VARCHAR(128) NOT NULL COMMENT 'undo_log context,such as serialization', `rollback_info` LONGBLOB NOT NULL COMMENT 'rollback info', `log_status` INT(11) NOT NULL COMMENT '0:normal status,1:defense 1:defense status', `log_created` DATETIME NOT NULL COMMENT 'create datetime', `log_modified` DATETIME NOT NULL COMMENT 'modify datetime', PRIMARY KEY (`id`), UNIQUE KEY `ux_undo_log` (`xid`, `branch_id`)0 码力 | 530 页 | 4.49 MB | 1 年前3Apache ShardingSphere 中文文档 5.2.0
StaticReadwriteSplittingStrategyConfiguration("demo_write_ds", Arrays.asList("demo_read_ds_0", "demo_read_ds_1")), null,"demo_ weight_lb"); Properties algorithmProps = new Properties(); algorithmProps.setProperty("demo_read_ds_0" Arrays.asList(createDatabaseDiscoveryConfiguration(), createReadwriteSplittingConfiguration()), null); private static DatabaseDiscoveryRuleConfiguration createDatabaseDiscoveryConfiguration() { D "name_ encryptor", null); EncryptColumnRuleConfiguration columnConfigTest = new EncryptColumnRuleConfiguration("pwd", "pwd", "assisted_query_pwd", "", "pwd_ encryptor", null); EncryptTableRuleConfiguration0 码力 | 449 页 | 5.85 MB | 1 年前3
共 25 条
- 1
- 2
- 3