能力强的人善于解决问题,有智慧的人善于绕过问题。 区别很微妙,小心谨慎做后者。
全部博文(399)
分类: LINUX
2012-12-21 16:10:47
1)
Work work = new Work() { public void execute(Connection connection) throws SQLException { Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery(sql); while (rs.next()) { } } }; session.doWork(work);
2)
JdbcTemplate sjt = new JdbcTemplate(SessionFactoryUtils.getDataSource(sessionFactory));
List output = sjt.queryForList(" raw sql");
The output here is List