There are two patterns of Derby, Embedded and Network Server.Pattern I: how to connect to the database?1. load the embedded driver;2. wanna create a DB? then set some properites;3. create and connect to the database using DriverManager; how to operate on the DB?1. create a statement from the connect Read More
posted @ 2012-01-08 23:13 技术草根女 Views(588) Comments(0) Diggs(0) Edit
Simple demo of accessing DB using JNDI.How to get the connection? 1. get context;2. lookup for datasource config;3. get connection from this datasource;How to execute SQL? 1. declear SQL String;2. transform sql into statment on the connection we have got;3. execute the statement to get the result se Read More
posted @ 2012-01-08 22:05 技术草根女 Views(165) Comments(0) Diggs(0) Edit
A very simple server-sideexample here.one acceptor plus one handler.public class MinaTimeServer{ private static final int PORT = 9123; public static void main( String[] args ) throws IOException { IoAcceptor acceptor = new NioSocketAcceptor(); /* acceptor.getFilterChain... Read More
posted @ 2012-01-08 17:42 技术草根女 Views(456) Comments(0) Diggs(0) Edit
OK. This is my first lesson about MINA.[1] A lot of questions about Mina, yeah?Who is her?What transport does Mina support?How can I start developing?So, as the first step, I refer to http://mina.apache.org/faq.html[2] Mark some very links here.User Guide: http://mina.apache.org/documentation.htmlDe Read More
posted @ 2012-01-08 00:40 技术草根女 Views(571) Comments(0) Diggs(0) Edit