Class JdbcUtils

java.lang.Object
net.hydromatic.quidem.record.JdbcUtils

public abstract class JdbcUtils extends Object
JDBC utilities.
  • Method Details

    • write

      public static void write(StringBuilder b, ResultSet r) throws SQLException
      Writes a ResultSet to a builder.

      Representation is like the following:

         dname:VARCHAR, c:INTEGER
         SALES, 3
         MARKETING, 4
       
      Throws:
      SQLException
    • parse

      public static void parse(String[] fields, String s)
      Parses a line containing comma-separated values into an array of strings.

      Assumes that the array has exactly the right number of slots. Puts nulls into slots where the string is empty or there are not enough commas.

      If field values start with a single-quote, reads until it finds a closing single-quote. Commas inside single-quotes are part of the value. Single-quotes that are part of the value must be doubled.