Examples of ConnectionCallback


Examples of lcmc.common.domain.ConnectionCallback

            if (sshGui == null) {
                sshGui = new SSHGui(guiData.getMainFrame(), this, null);
            }

            connect(sshGui,
                    new ConnectionCallback() {
                        @Override
                        public void done(final int flag) {
                            setConnected();
                            getSSH().execCommandAndWait(new ExecCommandConfig()
                                                            .command(":") /* activate sudo */
 
View Full Code Here

Examples of lcmc.common.domain.ConnectionCallback

    private String connectHost() {
        final SSHGui sshGui = new SSHGui(getDialogPanel(), getHost(), getProgressBar());

        getHost().connect(sshGui, getProgressBar(),
                     new ConnectionCallback() {
                         @Override
                         public void done(final int flag) {
                             /* flag 0 now connected
                              * flag 1 already connected. */
                             LOG.debug1("done: callback done flag: " + flag);
View Full Code Here

Examples of org.springframework.jca.cci.core.ConnectionCallback

    MockControl connectionFactoryControl = MockControl.createStrictControl(ConnectionFactory.class);
    ConnectionFactory connectionFactory = (ConnectionFactory) connectionFactoryControl.getMock();
    MockControl connectionControl = MockControl.createStrictControl(Connection.class);
    Connection connection = (Connection) connectionControl.getMock();
    MockControl connectionCallbackControl = MockControl.createStrictControl(ConnectionCallback.class);
    ConnectionCallback connectionCallback = (ConnectionCallback) connectionCallbackControl.getMock();

    Object obj = new Object();

    connectionFactory.getConnection();
    connectionFactoryControl.setReturnValue(connection);

    connectionCallback.doInConnection(connection, connectionFactory);
    connectionCallbackControl.setReturnValue(obj);

    connection.close();
    connectionControl.setVoidCallable(1);
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

  public OracleTypeHandler(DatabaseMetaData databaseMetaData) throws SQLException {
    super(databaseMetaData);
  }

  public Object transformInputValue(JdbcTemplate jdbcTemplate, SqlParameter sqlParameter, Object value){
    ConnectionCallback connectionCallback;

    switch (sqlParameter.getSqlType()){
      case Types.STRUCT:
      case Types.ARRAY:
        connectionCallback = new TransformInputConnectionCallback(sqlParameter, value);
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

    return value;
  }

  public Object transformOutputValue(JdbcTemplate jdbcTemplate, SqlParameter sqlParameter, Object value, Class<?> type) {
    ConnectionCallback connectionCallback;

    switch (sqlParameter.getSqlType()){
      case Types.STRUCT:
      case Types.ARRAY:
      case OracleTypes.CURSOR:
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

            getGeneratedKeyNames().length  + " columns specified: " + Arrays.asList(getGeneratedKeyNames()));
      }
      // This is a hack to be able to get the generated key from a database that doesn't support
      // get generated keys feature.  HSQL is one, PostgreSQL is another.  Has to be done with the same
      // connection.
      jdbcTemplate.execute(new ConnectionCallback() {
        public Object doInConnection(Connection con) throws SQLException, DataAccessException {
          // Do the insert
          PreparedStatement ps = null;
          try {
            ps = con.prepareStatement(getInsertString());
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

        HashMap keys = new HashMap(1);
        keys.put(getGeneratedKeyNames()[0], key);
        keyHolder.getKeyList().add(keys);
      }
      else {
        jdbcTemplate.execute(new ConnectionCallback() {
          public Object doInConnection(Connection con) throws SQLException, DataAccessException {
            // Do the insert
            PreparedStatement ps = null;
            try {
              ps = con.prepareStatement(getInsertString());
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

        HashMap keys = new HashMap(1);
        keys.put(getGeneratedKeyNames()[0], key);
        keyHolder.getKeyList().add(keys);
      }
      else {
        jdbcTemplate.execute(new ConnectionCallback() {
          public Object doInConnection(Connection con) throws SQLException, DataAccessException {
            // Do the insert
            PreparedStatement ps = null;
            try {
              ps = con.prepareStatement(getInsertString());
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

        this.transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new DataSourceTransactionManager(jdbcTemplate.getDataSource()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);

        // 初始化一些数据
        jdbcTemplate.execute(new ConnectionCallback() {

            public Object doInConnection(Connection c) throws SQLException, DataAccessException {
                DatabaseMetaData meta = c.getMetaData();
                databaseName = meta.getDatabaseProductName();
                databaseMajorVersion = meta.getDatabaseMajorVersion();
View Full Code Here

Examples of org.springframework.jdbc.core.ConnectionCallback

        return findTable(jdbcTemplate, catalogName, schemaName, tableName, null);
    }

    public static Table findTable(final JdbcTemplate jdbcTemplate, final String catalogName, final String schemaName,
                                  final String tableName, final DdlUtilsFilter filter) throws Exception {
        return (Table) jdbcTemplate.execute(new ConnectionCallback() {

            public Object doInConnection(Connection con) throws SQLException, DataAccessException {
                Table table = null;
                DatabaseMetaDataWrapper metaData = new DatabaseMetaDataWrapper();
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.