Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataSource dataSource = new PooledDataSource(
- "com.mysql.jdbc.Driver",
- "jdbc:mysql://HOST:PORT/SCHEMA",
- "USERNAME",
- "PASSWORD");
- TransactionFactory transactionFactory = new JdbcTransactionFactory();
- Environment environment = new Environment("development", transactionFactory, dataSource);
- Configuration configuration = new Configuration(environment);
- configuration.addMapper(MyMapper.class);
- SqlSessionFactory sqlSessionFactory = new SqlSessionFactoryBuilder().build(configuration);
- SqlSession session = sqlSessionFactory.openSession();
- MyMapper mapper = session.getMapper(MyMapper.class);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement