/** * Get the DDL file and execute the statements. * @param fileNamePrefix the common prefix for the DDL file name * @param resourceName the jdbc resource name that would be used * to get a connection to the database. * @return true if the statements were successfully in the database. */ public boolean executeDDLStatement(String fileNamePrefix, String resourceName) { File file = null; Connection conn = null; try { conn = getConnection(resourceName); DatabaseMetaData dbMetaData = conn.getMetaData(); String vendorName = DBVendorTypeHelper.getDBType( dbMetaData.getDatabaseProductName()).toLowerCase(Locale.ENGLISH); file = new File(fileNamePrefix + vendorName + DatabaseConstants.SQL_FILE_EXTENSION); logger.fine("===> File to use: " + file); } catch (IOException e) { fileIOError(appRegisteredName, e); } catch (Exception ex) { cannotConnect(resourceName, ex); } finally { closeConn(conn); } return executeDDLStatement(file, resourceName); }
fileIOError(appRegisteredName, e); } finally { if (sql != null) {