Package com.mysql.jdbc

Examples of com.mysql.jdbc.SocketFactory


      Properties hostSpecificProps = NonRegisteringDriver.expandHostKeyValues(hostnameToConnectTo);
     
      String protocol = hostSpecificProps.getProperty(NonRegisteringDriver.PROTOCOL_PROPERTY_KEY);
     
      if ("unix".equalsIgnoreCase(protocol)) {
        SocketFactory factory;
        try {
          factory = (SocketFactory) Class
              .forName(
                  "org.newsclub.net.mysql.AFUNIXDatabaseSocketFactory")
              .newInstance();
        } catch (InstantiationException e) {
          throw new SocketException(e.getMessage());
        } catch (IllegalAccessException e) {
          throw new SocketException(e.getMessage());
        } catch (ClassNotFoundException e) {
          throw new SocketException(e.getMessage());
        }

        String path = hostSpecificProps
            .getProperty(NonRegisteringDriver.PATH_PROPERTY_KEY);

        if (path != null) {
          hostSpecificProps.setProperty("junixsocket.file", path);
        }

        return new HangingSocket(factory.connect(hostnameToConnectTo,
            portNumber, hostSpecificProps), props, hostname);
      }

    }
   
View Full Code Here


      Properties hostSpecificProps = NonRegisteringDriver.expandHostKeyValues(hostnameToConnectTo);
     
      String protocol = hostSpecificProps.getProperty(NonRegisteringDriver.PROTOCOL_PROPERTY_KEY);
     
      if ("unix".equalsIgnoreCase(protocol)) {
        SocketFactory factory;
        try {
          factory = (SocketFactory) Class
              .forName(
                  "org.newsclub.net.mysql.AFUNIXDatabaseSocketFactory")
              .newInstance();
        } catch (InstantiationException e) {
          throw new SocketException(e.getMessage());
        } catch (IllegalAccessException e) {
          throw new SocketException(e.getMessage());
        } catch (ClassNotFoundException e) {
          throw new SocketException(e.getMessage());
        }

        String path = hostSpecificProps
            .getProperty(NonRegisteringDriver.PATH_PROPERTY_KEY);

        if (path != null) {
          hostSpecificProps.setProperty("junixsocket.file", path);
        }

        return new HangingSocket(factory.connect(hostnameToConnectTo,
            portNumber, hostSpecificProps), props, hostname);
      }

    }
   
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.SocketFactory

Copyright © 2018 www.massapicom. 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.