Skip to content
fujohnwang edited this page Dec 6, 2010 · 6 revisions

Welcome to the hs2client wiki!

Hs2Client is simple: 1- Simple to use: To use Hs2client, you only have to create a Hs2SessionFactoryImpl with a Hs2Conf, then you can open a session, no matter read only one or read/write one, to access mysql by using access methods that Hs2Session provides, e.g: val sessionFactory = new Hs2SessionFactoryImpl(Hs2Conf("host",connectionEncoding="GBK")) /* * open a readOnly session for read */ val session = sessionFactory.openSession(OpenIndexSpec("test", "dw", Array("id", "value")), true) try{ println("result: "+session.get(Eq(),Array("13")).mkString(",")) } finally{ session.close }

2- Simple to extend: You can extend hs2client by providing different parts of it, no matter Hs2SessionFactory, or Hs2Session, or even wrap Hs2client in a easier way.

Some concerns on implementing this client can be found here:

http://fujohnwang.blogspot.com/2010/12/n-things-you-should-know-about.html

Clone this wiki locally