问题
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