We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(5)
在 scala 中使用 JDBC 几乎是无缝的。就我而言,我编写了一个小型可重用数据库库,用于将 JDBC 桥接到 Scala(即,从 Scala 对象生成 SQL 并从结果生成 scala 对象)。
对于池化,您可以使用第 3 方数据库池库(例如 http://www.snaq.net /java/DBPool/)
在 Scala 中使用所有这些(一旦你的库完成)只需要很少的代码行。
Using JDBC in scala is pretty much seamless. In my case, I wrote a small reusable db library for bridging JDBC to Scala (i.e., generate SQL from Scala objects and generate scala objects from results).
For pooling, you could use a 3rd party db pool library (such as http://www.snaq.net/java/DBPool/)
Using all this in Scala (once your library is done) requires very few lines of code.
我更喜欢 SQueryL,因为它具有类似于 Scala 集合的语义,但访问数据库,这意味着通常使用 Scala 集合的操作可以更轻松地使用其抽象。 http://squeryl.org/
I prefer SQueryL as it has semantics like Scala Collections but accesses the database, this means that operations which usually use Scala collections can work more easily with its abstractions. http://squeryl.org/
ScalaQuery 不适合您吗? http://scalaquery.org/
Doesn'T ScalaQuery work for you? http://scalaquery.org/
如果您更喜欢 SQL 而不是 ORM,那么您绝对应该检查 O/R Broker JDBC 库。不幸的是我不确定它是否支持连接池。
If you prefer SQL over ORM you definitely should check O/R Broker JDBC library. Unfortunately I'm not sure if it supports connection pooling or not.
看来现在最流行的是 Slick,你应该检查一下 google 是否是最新的趋势:https://www.google.com/trends/explore#q=slick%20scala%2C%20scalikejdbc%2C%20Anorm&cmpt=q&tz=Etc%2FGMT-2
It seems that the most popular nowadays is Slick, and you should check if that is up-to-date with google trends: https://www.google.com/trends/explore#q=slick%20scala%2C%20scalikejdbc%2C%20Anorm&cmpt=q&tz=Etc%2FGMT-2