@Throws(Exception::class) fun testTypes() { try { this.stmt.execute("DROP TABLE IF EXISTS typesRegressTest") this.stmt.execute("CREATE TABLE typesRegressTest (varcharField VARCHAR(32), charField CHAR(2), enumField ENUM('1','2')," + "setField SET('1','2','3'), tinyblobField TINYBLOB, mediumBlobField MEDIUMBLOB, longblobField LONGBLOB, blobField BLOB)") this.rs = this.stmt.executeQuery("SELECT * from typesRegressTest") val rsmd: ResultSetMetaData = this.rs.getMetaData() val numCols: Int = rsmd.getColumnCount() for (i in 0 until numCols) { val columnName: String = rsmd.getColumnName(i + 1) val columnTypeName: String = rsmd.getColumnTypeName(i + 1) println("$columnName -> $columnTypeName") } } finally { this.stmt.execute("DROP TABLE IF EXISTS typesRegressTest") } }
Tests for types being returned correctly