|
Muhammad Al-Xorazmiy nomidagi Toshkent axborot texnologiya universiteti
|
bet | 4/4 | Sana | 07.01.2024 | Hajmi | 53,53 Kb. | | #131436 |
Bog'liq 13LabStatement 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
|
| |