scala快速学习之访问数据库利器 | AiTi修炼|重剑无锋,拈花微笑
Header
Header

scala快速学习之访问数据库利器

任何编程语言在实际应用中都或多或少与数据库打交道,对于Scala也不例外,在快速学习scala的过程中我们更需要了解有哪些便捷方式可以充当scala与数据库之间的桥梁。

目前面向scala的各种数据库访问框架大致有以下两种:非ORM以及ORM模式。

  •   ScalaQuery

The first one is ScalaQuery. It is the most mature one, and it tries to make queries use the same for-comprehension as Scala collections do.

  • Querulous

The second one is Querulous, which is a open source project from Twitter. This one gives you direct access to SQL, while dealing with a bunch of jdbc annoyances.

  • Squeryl

The third one is Squeryl. Style-wise, it sits midway between ScalaQuery — which hides SQL behind Scala comprehensions as much as possible — and Querulous — which uses SQL strings directly.

Squeryl provides a SQL-like DSL, which gives you type safety and give you a strong likelyhood that the statements won’t fail at run-time if they compile at all

  • O/R Broker

The fourth is O/R Broker, which, despite the name, is not an ORM. Classes can be designed in any way desired. No interfaces/traits to implement, no conventions to uphold, no annotations needed

rscala.com版权所有,本文scala快速学习之访问数据库利器转载请注明出处:http://rscala.com/index.php/163.html

该文章归档分类于 scala实践

3 Responses



Leave a Reply

电子邮件地址不会被公开。 必填项已用*标注

*

code