slick_plainSQL 发表于 2017-05-27 | 更新于 2019-05-07 | 评论数: | 阅读次数: slick3.1.1 使用sql语句查询1234567891011121314151617val db = Database.forURL("jdbc:mysql://ip:port/db?useUnicode=true", driver = "com.mysql.jdbc.Driver", user="root", password="root") def insertInvoice(): DBIO[Int] = sqlu"insert invoicelog values('sss','2017-05-26 12:00:00','sasas')" val b:Future[Int] = db.run(insertInvoice()) Await.result(b, Duration.Inf) implicit val getSupplierResult = GetResult(r => InvoiceLog(r.nextString(), r.nextString, r.nextString)) def selectInvoice(): DBIO[Seq[InvoiceLog]] = sql"select * from invoicelog".as[InvoiceLog]var a: Future[Seq[InvoiceLog]] = db.run(selectInvoice)val s = Await.result(a, Duration.Inf) 欢迎关注我的公众号:沉迷Spring 本文作者: John | 微信公众号【沉迷Spring】 本文链接: http://johnwonder.github.io/2017/05/27/slick-plainSQL/ 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!