import com.twitter.finagle.*; import com.mysql.jdbc.*; public class MySQLClient { public static void main(String[] args) { Mysql.ConnectionPoolFactory factory = Mysql.ConnectionPoolFactory( "jdbc:mysql://localhost:3306/mydb", "username", "password"); Service<Request, Response> client = ClientBuilder.safeBuild( factory.apply(), ClientConfig<TTransport, Mysql.FutureIface>( Mysql.FinagledClient() .withCapabilities(Class.forName( "com.twitter.finagle.exp.mysql.thrift.Mysql$FinagleClientCapability"))) ); } }


上一篇:
下一篇:
切换中文