跟我学Shiro - 张开涛r public class MySessionDAO extends CachingSessionDAO { private JdbcTemplate jdbcTemplate = JdbcTemplateUtils.jdbcTemplate(); protected Serializable doCreate(Session session) { Serializable , sessionId); String sql = "insert into sessions(id, session) values(?,?)"; jdbcTemplate.update(sql, sessionId, SerializableUtils.serialize(session)); return session.getId(); //如果会话过期/停止 没必要再更新了 } String sql = "update sessions set session=? where id=?"; jdbcTemplate.update(sql, SerializableUtils.serialize(session), session.getId()); } protected void0 码力 | 219 页 | 4.16 MB | 10 月前3
Apache ShardingSphere 中文文档 5.0.0-alphaDataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingTrans // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 301 页 | 3.44 MB | 1 年前3
Apache ShardingSphere 中文文档 5.0.0DataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingSpher // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 385 页 | 4.26 MB | 1 年前3
Apache ShardingSphere 中文文档 5.1.1DataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingSpher // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 409 页 | 4.47 MB | 1 年前3
Apache ShardingSphere 中文文档 5.2.0158 Apache ShardingSphere document, v5.2.0 @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingSpher // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 449 页 | 5.85 MB | 1 年前3
Apache ShardingSphere 中文文档 5.1.0DataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingSpher // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 406 页 | 4.40 MB | 1 年前3
Apache ShardingSphere 中文文档 5.1.2DataSourceTransactionManager(dataSource); } @Bean public JdbcTemplate jdbcTemplate(final DataSource dataSource) { return new JdbcTemplate(dataSource); } } 使用分布式事务 @Transactional @ShardingSpher // 支持 TransactionType.LOCAL, TransactionType.XA, TransactionType.BASE public void insert() { jdbcTemplate.execute("INSERT INTO t_order (user_id, status) VALUES (?, ?)", (PreparedStatementCallback0 码力 | 446 页 | 4.67 MB | 1 年前3
Kotlin 1.9.10 官方文档 中文版
you use JDBC to interact with databases. For convenience, the Spring Framework provides the JdbcTemplate class that simplifies the use of JDBC and helps to avoid common errors. Add database support springframework.stereotype.Service import org.springframework.jdbc.core.JdbcTemplate @Service class MessageService(val db: JdbcTemplate) { fun findMessages(): List= db.query("select * from our case, the constructor is (val db: JdbcTemplate) . val db: JdbcTemplate is the constructor's argument: @Service class MessageService(val db: JdbcTemplate) The findMessages() function calls 0 码力 | 3753 页 | 29.69 MB | 1 年前3
Kotlin 官方文档中文版 v1.9you use JDBC to interact with databases. For convenience, the Spring Framework provides the JdbcTemplate class that simplifies the use of JDBC and helps to avoid common errors. Add database support springframework.stereotype.Service import org.springframework.jdbc.core.JdbcTemplate @Service class MessageService(val db: JdbcTemplate) { fun findMessages(): List= db.query("select * from our case, the constructor is (val db: JdbcTemplate) . val db: JdbcTemplate is the constructor's argument: @Service class MessageService(val db: JdbcTemplate) The findMessages() function calls 0 码力 | 2049 页 | 45.06 MB | 1 年前3
共 9 条
- 1













