throw convertException("IOException reading from " + fileName, e);
/** * Reads from the CSV file and returns a result set. The rows in the result * set are created on demand, that means the file is kept open until all * rows are read or the result set is closed. * <br /> * If the columns are read from the CSV file, then the following rules are * used: columns names that start with a letter or '_', and only * contain letters, '_', and digits, are considered case insensitive * and are converted to uppercase. Other column names are considered * case sensitive (that means they need to be quoted when accessed). * * @param inputFileName the file name * @param colNames or null if the column names should be read from the CSV * file * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the result set */ public ResultSet read(String inputFileName, String[] colNames, String charset) throws SQLException { init(inputFileName, charset); try { return readResultSet(colNames); } catch (IOException e) { throw convertException("IOException reading " + inputFileName, e); } }
/** * Writes the result set to a file in the CSV format. The result set is read * using the following loop: * * <pre> * while (rs.next()) { * writeRow(row); * } * </pre> * * @param outputFileName the name of the csv file * @param rs the result set - the result set must be positioned before the * first row. * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the number of rows written */ public int write(String outputFileName, ResultSet rs, String charset) throws SQLException { init(outputFileName, charset); try { initWrite(); return writeResultSet(rs); } catch (IOException e) { throw convertException("IOException writing " + outputFileName, e); } }
throw convertException("IOException reading from " + fileName, e);
throw convertException("IOException reading from " + fileName, e);
throw convertException("IOException reading from " + fileName, e);
/** * Reads from the CSV file and returns a result set. The rows in the result * set are created on demand, that means the file is kept open until all * rows are read or the result set is closed. * * @param fileName the file name * @param colNames or null if the column names should be read from the CSV file * @param charset the charset or null to use UTF-8 * @return the result set * @throws SQLException */ public ResultSet read(String fileName, String[] colNames, String charset) throws SQLException { init(fileName, charset); try { return readResultSet(colNames); } catch (IOException e) { throw convertException("IOException reading " + fileName, e); } }
/** * Reads from the CSV file and returns a result set. The rows in the result * set are created on demand, that means the file is kept open until all * rows are read or the result set is closed. * <br /> * If the columns are read from the CSV file, then the following rules are * used: columns names that start with a letter or '_', and only * contain letters, '_', and digits, are considered case insensitive * and are converted to uppercase. Other column names are considered * case sensitive (that means they need to be quoted when accessed). * * @param inputFileName the file name * @param colNames or null if the column names should be read from the CSV * file * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the result set */ public ResultSet read(String inputFileName, String[] colNames, String charset) throws SQLException { init(inputFileName, charset); try { return readResultSet(colNames); } catch (IOException e) { throw convertException("IOException reading " + inputFileName, e); } }
/** * Reads from the CSV file and returns a result set. The rows in the result * set are created on demand, that means the file is kept open until all * rows are read or the result set is closed. * <br /> * If the columns are read from the CSV file, then the following rules are * used: columns names that start with a letter or '_', and only * contain letters, '_', and digits, are considered case insensitive * and are converted to uppercase. Other column names are considered * case sensitive (that means they need to be quoted when accessed). * * @param inputFileName the file name * @param colNames or null if the column names should be read from the CSV * file * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the result set */ public ResultSet read(String inputFileName, String[] colNames, String charset) throws SQLException { init(inputFileName, charset); try { return readResultSet(colNames); } catch (IOException e) { throw convertException("IOException reading " + inputFileName, e); } }
/** * Writes the result set to a file in the CSV format. * * @param fileName * the name of the csv file * @param rs * the result set * @param charset * the charset or null to use UTF-8 * @return the number of rows written * @throws SQLException */ public int write(String fileName, ResultSet rs, String charset) throws SQLException { init(fileName, charset); try { initWrite(); return writeResultSet(rs); } catch (IOException e) { throw convertException("IOException writing " + fileName, e); } }
/** * Writes the result set to a file in the CSV format. The result set is read * using the following loop: * * <pre> * while (rs.next()) { * writeRow(row); * } * </pre> * * @param outputFileName the name of the csv file * @param rs the result set - the result set must be positioned before the * first row. * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the number of rows written */ public int write(String outputFileName, ResultSet rs, String charset) throws SQLException { init(outputFileName, charset); try { initWrite(); return writeResultSet(rs); } catch (IOException e) { throw convertException("IOException writing " + outputFileName, e); } }
/** * Writes the result set to a file in the CSV format. The result set is read * using the following loop: * * <pre> * while (rs.next()) { * writeRow(row); * } * </pre> * * @param outputFileName the name of the csv file * @param rs the result set - the result set must be positioned before the * first row. * @param charset the charset or null to use the system default charset * (see system property file.encoding) * @return the number of rows written */ public int write(String outputFileName, ResultSet rs, String charset) throws SQLException { init(outputFileName, charset); try { initWrite(); return writeResultSet(rs); } catch (IOException e) { throw convertException("IOException writing " + outputFileName, e); } }