OmniSciDB  c07336695a
com.omnisci.jdbc.OmniSciColumnTypeTest Class Reference
+ Collaboration diagram for com.omnisci.jdbc.OmniSciColumnTypeTest:

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 14 of file OmniSciColumnTypeTest.java.

Member Function Documentation

◆ tst1_types()

void com.omnisci.jdbc.OmniSciColumnTypeTest.tst1_types ( ) throws Exception
inline

Definition at line 35 of file OmniSciColumnTypeTest.java.

References com.omnisci.jdbc.OmniSciColumnTypeTest.Answer.name, com.omnisci.jdbc.OmniSciColumnTypeTest.password, Experimental.String, com.omnisci.jdbc.OmniSciColumnTypeTest.Answer.type, and com.omnisci.jdbc.OmniSciColumnTypeTest.user.

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

Member Data Documentation

◆ answers

Answer [] com.omnisci.jdbc.OmniSciColumnTypeTest.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 27 of file OmniSciColumnTypeTest.java.

◆ password

final String com.omnisci.jdbc.OmniSciColumnTypeTest.password = PROPERTIES.getProperty("default_user_password")
staticpackage

◆ PROPERTIES

Properties com.omnisci.jdbc.OmniSciColumnTypeTest.PROPERTIES = new Property_loader("type_test.properties")
staticpackage

Definition at line 15 of file OmniSciColumnTypeTest.java.

◆ url

final String com.omnisci.jdbc.OmniSciColumnTypeTest.url = PROPERTIES.getProperty("default_db_connection_url")
staticpackage

Definition at line 16 of file OmniSciColumnTypeTest.java.

◆ user

final String com.omnisci.jdbc.OmniSciColumnTypeTest.user = PROPERTIES.getProperty("default_super_user")
staticpackage

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