@param ApplicationRoot The current running context of the application @return The amount of classes currently existing in the database
(String ApplicationRoot)
| 343 | * @return The amount of classes currently existing in the database |
| 344 | */ |
| 345 | public static int getClassCount(String ApplicationRoot) |
| 346 | { |
| 347 | int result = 0; |
| 348 | ResultSet resultSet = null; |
| 349 | log.debug("*** Getter.getClassCount ***"); |
| 350 | Connection conn = Database.getCoreConnection(ApplicationRoot); |
| 351 | try |
| 352 | { |
| 353 | CallableStatement callstmt = conn.prepareCall("call classCount()"); |
| 354 | log.debug("Gathering classCount ResultSet"); |
| 355 | resultSet = callstmt.executeQuery(); |
| 356 | log.debug("Opening Result Set from classCount"); |
| 357 | resultSet.next(); |
| 358 | result = resultSet.getInt(1); |
| 359 | } |
| 360 | catch (SQLException e) |
| 361 | { |
| 362 | log.error("Could not execute query: " + e.toString()); |
| 363 | result = 0; |
| 364 | } |
| 365 | Database.closeConnection(conn); |
| 366 | log.debug("*** END getClassCount"); |
| 367 | return result; |
| 368 | } |
| 369 | |
| 370 | /** |
| 371 | * @param ApplicationRoot The current running context of the application |