Package com.mysql.jdbc

Examples of com.mysql.jdbc.Buffer


      this.password = password;
    }

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
        toServer.clear();
        Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
        toServer.add(bresp);
      return true;
    }
View Full Code Here


    }

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
        toServer.clear();
        if ((fromServer.getByteBuffer()[0] & 0xff) == 4) {
          Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
          toServer.add(bresp);
        } else {
          Buffer bresp = new Buffer(StringUtils.getBytes("yes, of course"));
          toServer.add(bresp);
        }
      return true;
    }
View Full Code Here

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
      toServer.clear();
      this.counter++;
      if ((fromServer.getByteBuffer()[0] & 0xff) == 4) {
        Buffer bresp = new Buffer(StringUtils.getBytes(counter>2 ? this.password : "wrongpassword"+counter));
        toServer.add(bresp);
      } else {
        Buffer bresp = new Buffer(fromServer.getByteBuffer());
        toServer.add(bresp);
      }
      return true;
    }
View Full Code Here

  }

  public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
    toServer.clear();

    Buffer bresp = new Buffer(StringUtils.getBytes(this.password != null ? this.password : ""));

    bresp.setPosition(bresp.getBufLength());
    int oldBufLength = bresp.getBufLength();
   
    bresp.writeByte((byte)0);
   
    bresp.setBufLength(oldBufLength + 1);
    bresp.setPosition(0);

    toServer.add(bresp);
    return true;
  }
View Full Code Here

  public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {

    try {
      toServer.clear();

      Buffer bresp = null;
     
      String pwd = this.password;
      if (pwd == null) {
        pwd = this.properties.getProperty("password");
      }
     
      if (fromServer == null || pwd == null || pwd.length() == 0) {
        bresp = new Buffer(new byte[0]);
      } else {
        bresp = new Buffer(Security.scramble411(pwd, fromServer.readString(), this.connection));
      }
      toServer.add(bresp);
     
    } catch (NoSuchAlgorithmException nse) {
      throw SQLError.createSQLException(Messages.getString("MysqlIO.95") //$NON-NLS-1$
View Full Code Here

  }

  public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
    toServer.clear();

    Buffer bresp = new Buffer(StringUtils.getBytes(this.password != null ? this.password : ""));

    bresp.setPosition(bresp.getBufLength());
    int oldBufLength = bresp.getBufLength();
   
    bresp.writeByte((byte)0);
   
    bresp.setBufLength(oldBufLength + 1);
    bresp.setPosition(0);

    toServer.add(bresp);
    return true;
  }
View Full Code Here

  }

  public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
    toServer.clear();
   
    Buffer bresp = null;

    String pwd = this.password;
    if (pwd == null) {
      pwd = this.properties.getProperty("password");
    }
   
    bresp = new Buffer(StringUtils.getBytes( fromServer == null || pwd == null || pwd.length() == 0 ? "" :  Util.newCrypt(pwd, fromServer.readString().substring(0, 8)) ));

    bresp.setPosition(bresp.getBufLength());
    int oldBufLength = bresp.getBufLength();
   
    bresp.writeByte((byte)0);
   
    bresp.setBufLength(oldBufLength + 1);
    bresp.setPosition(0);
   
    toServer.add(bresp);
   
    return true;
  }
View Full Code Here

    }

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
        toServer.clear();
        if ((fromServer.getByteBuffer()[0] & 0xff) == 4) {
          Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
          toServer.add(bresp);
        } else {
          Buffer bresp = new Buffer(StringUtils.getBytes("yes, of course"));
          toServer.add(bresp);
        }
      return true;
    }
View Full Code Here

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
      toServer.clear();
      this.counter++;
      if ((fromServer.getByteBuffer()[0] & 0xff) == 4) {
        Buffer bresp = new Buffer(StringUtils.getBytes(counter>2 ? this.password : "wrongpassword"+counter));
        toServer.add(bresp);
      } else {
        Buffer bresp = new Buffer(fromServer.getByteBuffer());
        toServer.add(bresp);
      }
      return true;
    }
View Full Code Here

      this.password = password;
    }

    public boolean nextAuthenticationStep(Buffer fromServer, List<Buffer> toServer) throws SQLException {
        toServer.clear();
        Buffer bresp = new Buffer(StringUtils.getBytes(this.password));
        toServer.add(bresp);
      return true;
    }
View Full Code Here

TOP

Related Classes of com.mysql.jdbc.Buffer

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.