Commit 29/09/2025

This commit is contained in:
rdkartono
2025-09-29 11:56:08 +07:00
parent f18a0ca9cd
commit cf24c06b35
6 changed files with 1004 additions and 845 deletions

View File

@@ -2218,4 +2218,25 @@ class MariaDB(
return false
}
fun Get_User_List(): ArrayList<UserDB> {
val userList = ArrayList<UserDB>()
try {
val statement = connection?.createStatement()
val resultSet = statement?.executeQuery("SELECT * FROM user")
while (resultSet?.next() == true) {
val user = UserDB(
resultSet.getLong("index").toUInt(),
resultSet.getString("username"),
resultSet.getString("password"),
resultSet.getString("location")
)
userList.add(user)
}
} catch (e: Exception) {
Logger.error("Error fetching user list: ${e.message}" as Any)
}
return userList
}
}