8889909192939495969798
{ conn = DatabaseConnection.getNewConnection(); Word[] words = new Word[input.length]; for (int i = 0; i < words.length; i++) { Word w = WordProvider.convertToWord(conn, input[i]); words[i] = w; } return words; } finally
124125126127128129130131132133134
* @return The word instance or null if not used. */ public static Word convertToWord(Connection conn, String wordStr) { if (isWordUsed(wordStr)) { Word word = getExistingWord(conn, wordStr); if (word == null) { try { createWord(conn, wordStr);
163164165166167168169170171172173
rs = statement.executeQuery(); if (rs.next()) { int wordId = rs.getInt("WordId"); String tag = rs.getString("Tag"); return new Word(wordId, tag); } else { return null; }