OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ai.heavy.jdbc.HeavyAIColumnTypeTest Class Reference
+ Collaboration diagram for ai.heavy.jdbc.HeavyAIColumnTypeTest:

Classes

class  Answer
 

Public Member Functions

void tst1_types () throws Exception
 

Static Package Attributes

static Properties PROPERTIES = new Property_loader("type_test.properties")
 
static final String url = PROPERTIES.getProperty("default_db_connection_url")
 
static final String user = PROPERTIES.getProperty("default_super_user")
 
static final String password = PROPERTIES.getProperty("default_user_password")
 

Private Attributes

Answer[] answers
 

Detailed Description

Definition at line 11 of file HeavyAIColumnTypeTest.java.

Member Function Documentation

void ai.heavy.jdbc.HeavyAIColumnTypeTest.tst1_types ( ) throws Exception
inline

Definition at line 32 of file HeavyAIColumnTypeTest.java.

References ai.heavy.jdbc.HeavyAIColumnTypeTest.answers, report.conn, setup.name, ai.heavy.jdbc.HeavyAIColumnTypeTest.password, run_benchmark_import.type, ai.heavy.jdbc.HeavyAIColumnTypeTest.url, and ai.heavy.jdbc.HeavyAIColumnTypeTest.user.

32  {
33  Connection conn = DriverManager.getConnection(url, user, password);
34  assertNotEquals(null, conn);
35  Statement statement = conn.createStatement();
36  try {
37  statement.executeUpdate(PROPERTIES.getProperty("drop_base_db"));
38  } catch (SQLException sQ) {
39  }
40 
41  statement.executeUpdate(PROPERTIES.getProperty("create_base_db"));
42  statement.close();
43  conn.close();
44  conn = DriverManager.getConnection(
45  PROPERTIES.getProperty("base_db_connection_url"), user, password);
46  statement = conn.createStatement();
47  statement.executeUpdate(PROPERTIES.getProperty("drop_base_table1"));
48  statement.executeUpdate(PROPERTIES.getProperty("create_base_table1"));
49 
50  ResultSet rs = statement.executeQuery(PROPERTIES.getProperty("select_base_table1"));
51  ResultSetMetaData rs_md = rs.getMetaData();
52  int col_cnt = rs_md.getColumnCount();
53  while (col_cnt > 0) {
54  int type = rs_md.getColumnType(col_cnt);
55  String name = rs_md.getColumnTypeName(col_cnt--);
56  assertEquals(type, answers[col_cnt].type);
57  assertEquals(name, answers[col_cnt].name);
58  }
59  statement.executeUpdate(PROPERTIES.getProperty("drop_base_table1"));
60  statement.executeUpdate(PROPERTIES.getProperty("drop_base_db"));
61  }
tuple conn
Definition: report.py:41
string name
Definition: setup.in.py:72

Member Data Documentation

Answer [] ai.heavy.jdbc.HeavyAIColumnTypeTest.answers
private
Initial value:
= {new Answer(java.sql.Types.INTEGER, "INT"),
new Answer(java.sql.Types.FLOAT, "FLOAT"),
new Answer(java.sql.Types.OTHER, "POINT"),
new Answer(java.sql.Types.OTHER, "LINESTRING"),
new Answer(java.sql.Types.OTHER, "POLYGON"),
new Answer(java.sql.Types.OTHER, "MULTIPOLYGON")}

Definition at line 24 of file HeavyAIColumnTypeTest.java.

Referenced by ai.heavy.jdbc.HeavyAIColumnTypeTest.tst1_types().

final String ai.heavy.jdbc.HeavyAIColumnTypeTest.password = PROPERTIES.getProperty("default_user_password")
staticpackage
Properties ai.heavy.jdbc.HeavyAIColumnTypeTest.PROPERTIES = new Property_loader("type_test.properties")
staticpackage

Definition at line 12 of file HeavyAIColumnTypeTest.java.

final String ai.heavy.jdbc.HeavyAIColumnTypeTest.url = PROPERTIES.getProperty("default_db_connection_url")
staticpackage
final String ai.heavy.jdbc.HeavyAIColumnTypeTest.user = PROPERTIES.getProperty("default_super_user")
staticpackage

The documentation for this class was generated from the following file: