How to connect lift and MySQL?

折月煮酒 提交于 2019-12-05 07:56:59

问题


I want to create a simple lift web application which read input throug form and insert it into database.


回答1:


You need to add mysql jdbc driver to your project (as a maven artifact, or via sbt, or just put jar in CLASSPATH) and edit properties file (props/default.props):

db.driver=com.mysql.jdbc.Driver
db.url=jdbc:mysql://localhost/your_db_name
db.user=user
db.password=password

Also, you can setup db context in app container (Tomcat, etc.) instead. After that you can use Lift's ORM (Mapper).



来源:https://stackoverflow.com/questions/5180040/how-to-connect-lift-and-mysql

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!