Skip to content

Instantly share code, notes, and snippets.

@dbousamra
Created January 29, 2012 09:30
Show Gist options
  • Save dbousamra/1698022 to your computer and use it in GitHub Desktop.
Save dbousamra/1698022 to your computer and use it in GitHub Desktop.
class Testingclass {
val jdbcTemplate = new JdbcTemplate
implicit def rowMapper[T <: AnyRef](f: (ResultSet) => T) =
new ParameterizedRowMapper[T] {
override def mapRow(rs: ResultSet, row: Int): T = f(rs)
}
val rowFunction = { rs:ResultSet => rs.getString("COLNAME") }
val stuffFromMSF010 = jdbcTemplate.query(
"SELECT * FROM MSF010",
rowFunction
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment