Updates from April, 2008 Toggle Comment Threads | Keyboard Shortcuts

  • Tyler 7:42 pm on April 15, 2008 Permalink
    Tags: ,   

    New Lift App 

    Working on another /lift/ app for fun.
    itwasbetter

     
  • Tyler 2:05 pm on November 24, 2007 Permalink
    Tags: , , mysql,   

    Using MySql with Lift 

    I need to use MySQL with my Lift webapp and here’s how I did it. In Boot.scala I replaced the Derby DBVendor object with a MySQL object. Hope that helps.

    Add this to your pom.xml:

            <dependency>
              <groupid>mysql</groupid>
              <artifactid>mysql-connector-java</artifactid>
              <version>5.0.41</version>
            </dependency>
    

    object DBVendor extends ConnectionManager {
    def newConnection(name: ConnectionIdentifier): Can[Connection] = {
    try
    {
    Class.forName("com.mysql.jdbc.Driver")
    val dm = DriverManager.getConnection("jdbc:mysql://localhost:3306/database_name", "user", "password")
    Full(dm)
    }
    catch
    {
    case e : Exception => e.printStackTrace; Empty
    }
    }
    def releaseConnection(conn: Connection)
    {
    conn.close
    }
    }

    Next up is learning how to set up my domain objects properly.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
l
go to login
h
show/hide help
shift + esc
cancel