You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
valsessionFactory=newHs2SessionFactoryImpl(Hs2Conf("host",connectionEncoding="GBK"))
/* * open a readOnly session for read*/valsession= 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: