• System.out.println("Yozuvlarni qoshish..."); statement = connection.createStatement();
  • SQL = "INSERT into dasturchilar VALUE (3, Benur Qurbonov, Mobile Developer, 2000)"; statement.executeUpdate(SQL);
  • Muhammad Al-Xorazmiy nomidagi Toshkent axborot texnologiya universiteti




    Download 53,53 Kb.
    bet4/4
    Sana07.01.2024
    Hajmi53,53 Kb.
    #131436
    1   2   3   4
    Bog'liq
    13Lab

    Statement statement = null;
    try {
    System.out.println("JDBC drayverni ro'yxatdan o'tkazish...");
    Class.forName(JDBC_DRIVER);

    System.out.println("Ma'lumotlar bazasiga bog'lanish...");
    connection = DriverManager.getConnection(DATABASE_URL, USER, PASSWORD);

    System.out.println("Yozuvlarni qo'shish...");
    statement = connection.createStatement();

    String SQL = "INSERT into dasturchilar VALUE (1, 'Elbek Boymatov', 'Backend Developer', 3000)";
    statement.executeUpdate(SQL);
    SQL = "INSERT into dasturchilar VALUE (2, 'Abror Solijonov', 'Backend Developer', 2500)";
    statement.executeUpdate(SQL);
    SQL = "INSERT into dasturchilar VALUE (3, 'Benur Qurbonov', 'Mobile Developer', 2000)";
    statement.executeUpdate(SQL);
    SQL = "INSERT into dasturchilar VALUE (4, 'Sarvar Karimov', 'Frontend Developer', 1000)";
    statement.executeUpdate(SQL);

    } finally {
    if (statement != null) {
    statement.close();
    }
    if (connection != null) {
    connection.close();
    }
    }
    }
    }

    Dastur natijasi : 13.3


    Download 53,53 Kb.
    1   2   3   4




    Download 53,53 Kb.

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Muhammad Al-Xorazmiy nomidagi Toshkent axborot texnologiya universiteti

    Download 53,53 Kb.