This page is no longer maintained — Please continue to the home page at

Re: JdbcTemplate for Scala?

No replies
Stepan Koltsov
Joined: 2008-12-20,
User offline. Last seen 42 years 45 weeks ago.

I also have JdbcTemplate:

how to use:

val jdbcTemplate = new JdbcTemplate(...)

jdbcTemplate.query("SELECT * FROM users WHERE id = ?", 15).seq { rs =>
new User(rs.getLong("id"), rs.getString("login"), rs.getBoolean("enabled"))


On Thu, Sep 25, 2008 at 22:55, Erkki Lindpere wrote:
> I tried to use the DBC library included with Scala now, but frankly it's too
> difficult to use and I couldn't get it working for a rather simple use case.
> It badly needs some tutorials and documentation.
> But actually, even if I got it working, I'm not sure I would want the
> illusion of type safety it provides when I could just use actual SQL. Why
> not create some simpler wrappers for JDBC like the Spring JdbcTemplate
> instead (or as an alternative)?
> With closures it would be actually easier to use than the Spring
> JdbcTemplate and would provide an easier migration path from that or plain
> old JDBC.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland