在LiftWeb下配置PostgreSQL数据库
第一步:在pom.xml文件下的<dependencies></dependencies>处加入如下代码: 第二步:自定义数据库联接函数(单例对像) 在Boot类是加入如下代码: 1、 object DBVendor extends ConnectionManager { def newConnection(name: ConnectionIdentifier) = { def releaseConnection(conn: Connection) {conn.close} } 2、在def boot函数中加入如下代码: DB.defineConnectionManager(DefaultConnectionIdentifier,DBVendor) 这样在lift-web下配置postgresql数据就已经完成了 参考网站 http://wiki.liftweb.net/index.php/How_to_configure_lift_with_PostgreSQL (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |