sql2o 1.4.2 发布,此版本是个 bug 修复版本,修复了两个主要的问题:
- a thread safety issue in the enum converter and an Oracle QuirksMode which enables a workaround on the Oracle JDBC driver
- This defaults sql2o to avoid trying to fetch generated keys, as this might cause an OperationNotAllowed exception from the Oracle JDBC driver.
sql2o 是一个 Java 类库,可让你执行 SQL 查询并解析结果到 POJO 中,只需少数几行代码。
示例代码:
String sql = "SELECT id, category, duedate FROM tasks WHERE category = category";
Sql2o sql2o = new Sql2o(DB_URL, USER, PASS);
List<Task> tasks = sql2o.createQuery(sql).addParameter("category", "foo").executeAndFetch(Task.class);
sql2o 的详细介绍:请点这里
sql2o 的下载地址:请点这里
本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-05/101033.htm
