Examples of SQLServerDataSource


Examples of com.microsoft.jdbcx.sqlserver.SQLServerDataSource

  }

  public boolean bindDataSource(String bindName) {
    boolean isRegistered = false;
    try {
      SQLServerDataSource mds = new SQLServerDataSource();
      mds.setDescription("MS SQLServerDataSource");
      mds.setServerName("sqlserver");
      mds.setPortNumber(1433);
      mds.setDatabaseName("pubs");
      mds.setSelectMethod("cursor");
      ctx.rebind(bindName, mds);
      System.out.println("Bind success");
      isRegistered = true;
    } catch (Exception e) {
      System.out.println("Error Occured in JNDISetup:     " + e.getMessage());
View Full Code Here

Examples of com.microsoft.jdbcx.sqlserver.SQLServerDataSource

    }

    public void init(int branchId) throws XAException {
        try {
            // Initialize the Datasource
            SQLServerDataSource sqlServerDataSource = new SQLServerDataSource();

            // "jdbc:microsoft:sqlserver://bleujin:1433;DatabaseName=pubs;"
            String jdbcUrl = ( (MSSQLDBManager) dbm).getJdbcURL().trim() + ";";
            String serverInfo = StringUtils.substring(jdbcUrl, "jdbc:microsoft:sqlserver://".length());

            String serverName = StringUtils.substringBefore(serverInfo, ":");
            int portNum = Integer.parseInt(StringUtils.substringBetween(serverInfo, ":", ";"));
            String dbName = StringUtils.substringBetween(serverInfo, ";DatabaseName=", ";");

            sqlServerDataSource.setServerName(serverName);
            sqlServerDataSource.setDatabaseName(dbName);
            sqlServerDataSource.setPortNumber(portNum);

            sqlServerDataSource.setUser( ( (MSSQLDBManager) dbm).getUserId());
            sqlServerDataSource.setPassword( ( (MSSQLDBManager) dbm).getUserPwd());
            sqlServerDataSource.setSelectMethod("cursor");

            xaDataSource = sqlServerDataSource;
            xaConnection = xaDataSource.getXAConnection();

            xaResource = xaConnection.getXAResource();
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.