jfianl main 链接数据源
Posted phyxis_xu
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了jfianl main 链接数据源相关的知识,希望对你有一定的参考价值。
public static void main(String[] args) { C3p0Plugin cp = new C3p0Plugin("jdbc:mysql://localhost/safe", "root", "root"); cp.start(); ActiveRecordPlugin arp = new ActiveRecordPlugin(cp); arp.start(); arp.addMapping("driver", Driver.class); List<Driver> drivers = Driver.dao.find("select * from driver limit 0,20"); for(Driver d:drivers){ Set<Entry<String, Object>> set = d.getAttrsEntrySet(); Iterator<Entry<String, Object>> it = set.iterator(); System.out.println("================="); while(it.hasNext()){ Entry<String, Object> next = it.next(); System.out.println(next.getKey()+":"+next.getValue()); } System.out.println("================="); } }
以上是关于jfianl main 链接数据源的主要内容,如果未能解决你的问题,请参考以下文章
NDK: ant 错误 [javah] Exception in thread "main" java.lang.NullPointerException 多种解决办法(代码片段