Skip to content

Instantly share code, notes, and snippets.

View makisarvin's full-sized avatar

Makis Arvanitis makisarvin

  • Seattle, WA
View GitHub Profile
@makisarvin
makisarvin / gist:6719586
Created September 26, 2013 19:49
Code Sample for using JDBC with scala. The gem is the translation of the ResultSet to a stream (http://stackoverflow.com/questions/9636545/treating-an-sql-resultset-like-a-scala-stream)
object DaoUtil {
import java.sql.DriverManager
def main(args:Array[String]) {
Class.forName("com.mysql.jdbc.Driver").newInstance
val con = DriverManager.getConnection("jdbc:mysql://localhost/test?" +
"user=root&password=password")
val stmt = con.createStatement()
@makisarvin
makisarvin / ParsingExample.scala
Last active December 20, 2015 05:29
working with Serializers and Deserializers in MongoDB Casbah
package com.arvanitis
import org.bson.{BSON, Transformer}
import com.mongodb.casbah.Imports._
import com.mongodb.casbah.commons.conversions.MongoConversionHelper
// The business classes for the example
case class Offer(name: String, product:Option[Product])
case class Product(name: String, description: String, price: Double)