Ejemplo n.º 1
0
        public static List <String> ReadStrings(this H2Connection connection, String query)
        {
            var ret    = new List <String>();
            var reader = new H2Command(query, connection).ExecuteReader();

            while (reader.Read())
            {
                ret.Add(reader.GetString(0));
            }
            return(ret);
        }
Ejemplo n.º 2
0
        public static Dictionary <String, T> ReadMap <T>(this H2Connection connection, String query)
        {
            var ret    = new Dictionary <String, T>();
            var reader = new H2Command(query, connection).ExecuteReader();

            while (reader.Read())
            {
                var key   = reader.GetString(0);
                var value = reader.GetValue(1);
                if (value == DBNull.Value)
                {
                    ret[key] = default(T);
                }
                else
                {
                    ret[key] = (T)value;
                }
            }
            return(ret);
        }