Examples of connect()


Examples of com.alibaba.druid.mock.MockDriver.connect()

        String sql = "SELECT 1";

        MockDriver driver = new MockDriver();

        Connection conn = driver.connect(url, info);
        Statement stmt = conn.createStatement();

        ResultSet rs = stmt.executeQuery(sql);
        Assert.assertEquals(true, rs.next());
        Assert.assertEquals(1, rs.getInt(1));
View Full Code Here

Examples of com.alibaba.druid.proxy.DruidDriver.connect()

    public void test_driver_wrap() throws Exception {
        DruidDriver driver = new DruidDriver();

        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters=:name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

Examples of com.alibaba.druid.proxy.jdbc.DataSourceProxyImpl.connect()

        connectCount.incrementAndGet();

        DataSourceProxyImpl dataSource = getDataSource(url, info);

        return dataSource.connect(info);
    }

    /**
     * 参数定义: com.alibaba.druid.log.LogFilter=filter com.alibaba.druid.log.LogFilter.p1=prop-value
     * com.alibaba.druid.log.LogFilter.p2=prop-value
 
View Full Code Here

Examples of com.alibaba.otter.canal.parse.driver.mysql.MysqlConnector.connect()

    @Test
    public void testSimple() {
        DirectLogFetcher fetcher = new DirectLogFetcher();
        try {
            MysqlConnector connector = new MysqlConnector(new InetSocketAddress("127.0.0.1", 3306), "xxxxx", "xxxxx");
            connector.connect();
            sendBinlogDump(connector, "mysql-bin.001016", 4L, 3);

            fetcher.start(connector.getChannel());

            LogDecoder decoder = new LogDecoder(LogEvent.UNKNOWN_EVENT, LogEvent.ENUM_END_EVENT);
View Full Code Here

Examples of com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.connect()

    @Test
    public void testSimple() {

        MysqlConnection connection = new MysqlConnection(new InetSocketAddress("127.0.0.1", 3306), "xxxxx", "xxxxx");
        try {
            connection.connect();
        } catch (IOException e) {
            Assert.fail(e.getMessage());
        }

        TableMetaCache cache = new TableMetaCache(connection);
View Full Code Here

Examples of com.alibaba.otter.node.etl.common.io.download.DataRetriever.connect()

        Pipeline pipeline = configClientService.findPipeline(key.getIdentity().getPipelineId());
        DataRetriever dataRetriever = dataRetrieverFactory.createRetriever(pipeline.getParameters().getRetriever(),
                                                                           dataUrl, downloadDir);
        File archiveFile = null;
        try {
            dataRetriever.connect();
            dataRetriever.doRetrieve();
            archiveFile = dataRetriever.getDataAsFile();
        } catch (Exception e) {
            dataRetriever.abort();
            throw new PipeException("download_error", e);
View Full Code Here

Examples of com.alibaba.otter.node.etl.common.io.download.impl.aria2c.Aria2cRetriever.connect()

    @Test
    public void testDownLoad_ok() {
        DataRetriever retriever = new Aria2cRetriever("http://china.alibaba.com", tmp);
        try {
            retriever.connect();
            retriever.doRetrieve();
        } catch (DataRetrieveException ex) {
            retriever.abort();
        } finally {
            retriever.disconnect();
View Full Code Here

Examples of com.alibaba.rocketmq.research.rpc.DefaultRPCClient.connect()

* @author shijia.wxr<vintage.wang@gmail.com>
*/
public class Client {
    public static void main(String[] args) {
        RPCClient rpcClient = new DefaultRPCClient();
        boolean connectOK = rpcClient.connect(new InetSocketAddress("127.0.0.1", 2012), 1);
        System.out.println("connect server " + (connectOK ? "OK" : "Failed"));
        rpcClient.start();

        for (long i = 0;; i++) {
            try {
View Full Code Here

Examples of com.alibaba.rocketmq.research.rpc.RPCClient.connect()

* @author shijia.wxr<vintage.wang@gmail.com>
*/
public class Client {
    public static void main(String[] args) {
        RPCClient rpcClient = new DefaultRPCClient();
        boolean connectOK = rpcClient.connect(new InetSocketAddress("127.0.0.1", 2012), 1);
        System.out.println("connect server " + (connectOK ? "OK" : "Failed"));
        rpcClient.start();

        for (long i = 0;; i++) {
            try {
View Full Code Here

Examples of com.almende.eve.transport.xmpp.XmppService.connect()

      @Name("password") String password) throws Exception {
    AgentFactory factory = getAgentFactory();
   
    XmppService service = (XmppService) factory.getTransportService("xmpp");
    if (service != null) {
      service.connect(getId(), username, password);
    }
    else {
      throw new Exception("No XMPP service registered");
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.