Package org.teiid.jdbc

Examples of org.teiid.jdbc.StatementImpl


    this.client.sslDenied();
  }
 
  private void setEncoding() {
    try {
      StatementImpl t = connection.createStatement();
      ResultSet rs = t.executeQuery("show client_encoding"); //$NON-NLS-1$
      if (rs.next()) {
        String encoding = rs.getString(1);
        if (encoding != null) {
          //this may be unnecessary
          this.client.setEncoding(encoding);
View Full Code Here


          sql = reader.readStatement();
              modfiedSQL = fixSQL(sql);
        }
            while (modfiedSQL != null) {
                try {
                  final StatementImpl stmt = connection.createStatement();
                    executionFuture = stmt.submitExecute(modfiedSQL);
                    executionFuture.addCompletionListener(new ResultsFuture.CompletionListener<Boolean>() {
                  @Override
                  public void onCompletion(ResultsFuture<Boolean> future) {
                    executionFuture = null;
                    try {
                      ResultsFuture<Void> result = null;
                          if (future.get()) {
                            if (stmt.getResultSet() != null) {
                              result = new ResultsFuture<Void>();
                                    client.sendResults(sql, stmt.getResultSet(), result, true);
                            }
                            else {
                              // handles the "SET" commands.
                              result = ResultsFuture.NULL_FUTURE;
                              client.sendUpdateCount(sql, 0);
                            }                           
                          } else {
                            result = ResultsFuture.NULL_FUTURE;
                            client.sendUpdateCount(sql, stmt.getUpdateCount());
                            setEncoding();
                          }
                          result.addCompletionListener(new ResultsFuture.CompletionListener<Void>() {
                                  public void onCompletion(ResultsFuture<Void> future) {
                                    try {
                        future.get();
                                sql = reader.readStatement();
                                modfiedSQL = fixSQL(sql);
                      } catch (InterruptedException e) {
                        throw new AssertionError(e);
                      } catch (IOException e) {
                        client.errorOccurred(e);
                        return;
                      } catch (ExecutionException e) {
                        client.errorOccurred(e.getCause());
                        return;
                      } finally {
                        try {
                          stmt.close();
                        } catch (SQLException e) {
                          LogManager.logDetail(LogConstants.CTX_ODBC, e, "Error closing statement"); //$NON-NLS-1$
                        }
                      }
                          QueryWorkItem.this.run(); //continue processing
View Full Code Here

TOP

Related Classes of org.teiid.jdbc.StatementImpl

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.