Package com.ubx1.pdpscanner.server.database

Examples of com.ubx1.pdpscanner.server.database.MySQLConnection.connect()


     * Login validation
     */
    Validator.validateLogin(username, password);

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    username = "'" + username + "'";

    ResultSet rs = conn.SQLSelect("SELECT * FROM users WHERE username = "
        + username + " LIMIT 1");
View Full Code Here


     */
    Validator.validateSignUp(name, email, username, password, password,
        cell);

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    ResultSet rs = conn.SQLSelect("SELECT * FROM users");

    // Check username unicity
    while (rs.next()) {
View Full Code Here

      throw new InvalidSessionException();
    }

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    ResultSet rs = conn.SQLSelect("SELECT password FROM users WHERE id="
        + userId);

    if (rs.next()) {
View Full Code Here

      throw new InvalidSessionException();
    }

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    newPassword = "'" + BCrypt.hashpw(newPassword, BCrypt.gensalt()) + "'";

    conn.SQLUpdate("UPDATE users SET password=" + newPassword
        + " WHERE id=" + userId);
View Full Code Here

   */
  @Override
  public Project[] fetchProjects() throws Exception {

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    ResultSet rs1 = conn
        .SQLSelect("SELECT * FROM projects JOIN users_in_projects ON projects.id = users_in_projects.project "
            + "JOIN users ON "
            + "users_in_projects.user = users.id "
View Full Code Here

      try {
        checkProjectRepository(svnUrl, svnUser, svnPassword);

        MySQLConnection conn = new MySQLConnection();
        conn.connect();

        ResultSet rs = conn.SQLSelect("SELECT * FROM projects");

        // Check project name unicity
        while (rs.next()) {
View Full Code Here

   * @return a null String object
   */
  public String deleteProject(int id) throws Exception {

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    // First delete the associated stats
    conn.SQLUpdate("DELETE FROM general_stats "
        + "USING versions,general_stats " + "WHERE versions.project = "
        + id + " AND general_stats.version = versions.id");
View Full Code Here

   */
  @Override
  public Project fetchStats(Project p) throws Exception {

    MySQLConnection conn = new MySQLConnection();
    conn.connect();

    // Get project's stats for all versions
    ResultSet rs1 = conn
        .SQLSelect("SELECT * FROM versions JOIN general_stats "
            + "ON general_stats.version = versions.id "
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.