正在加载图片...
简单的 Connection工具类别 onlyfun. caterpillar. driver=com mysql jdbc Driver onlyfun. caterpillar. url=jdbc: mysql: //localhost: 3306/demo onlyfun. caterpillar.user=root onlyfun caterpillar password=123456 DBSource dbsource new simpleDBSource()i Connection conn =dbsource getConnection ()i f(! conn. isClosedo)( System.out. println("数据库连接已开后…"); dbsource. closeConnection(conn)i if(conn is closed()) System.out. println("数据库连接已矢闭…");简单的Connection工具类别 onlyfun.caterpillar.driver=com.mysql.jdbc.Driver onlyfun.caterpillar.url=jdbc:mysql://localhost:3306/demo onlyfun.caterpillar.user=root onlyfun.caterpillar.password=123456 DBSource dbsource = new SimpleDBSource(); Connection conn = dbsource.getConnection(); if(!conn.isClosed()) { System.out.println("数据库连接已开启…"); } dbsource.closeConnection(conn); if(conn.isClosed()) { System.out.println("数据库连接已关闭…"); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有