内容简介:人生苦短,我却用 Java ......就是数据库读张表,一个 sql 的事儿,能不能简单点?hibernate,mybatis 配置来配置去 ......
人生苦短,我却用 Java ......
就是数据库读张表,一个 sql 的事儿,能不能简单点?
hibernate,mybatis 配置来配置去 ......
还有 能不能不要用 bean?怎么就读张表,却还要写个 bean?更不要说项目里一坨的 bean 来 bean 去 ......
直接用 jdbc?你还是杀了我吧 ......
我就想这样:
for (final JSONObject item : jdbcReader.read("select * from tablename")) {
System.err.println(item);
}
还有这样:
final Collection<JSONObject> items = jdbcReader.readAll("select * from tablename where type = ?", param);
OK!
参见:
maven: https://mvnrepository.com/artifact/io.iteratorx/iteratorx
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Impractical Python Projects
Lee Vaughan / No Starch Press / 2018-11 / USD 29.95
Impractical Python Projects picks up where the complete beginner books leave off, expanding on existing concepts and introducing new tools that you’ll use every day. And to keep things interesting, ea......一起来看看 《Impractical Python Projects》 这本书的介绍吧!