JDBC Driver for Quickbase

Build 22.0.8462

Primary Keys

You can use the getPrimaryKeys method to return information about the primary keys for Quickbase tables. You can restrict the results by the table name.

The following code example outputs the column or columns composing the primary key for the [CData].[QuickBase].SampleTable_1 table:

String connectionString = "jdbc:quickbase:[email protected];Password=test_1234;Domain=test.quickbase.com;ApplicationToken='bwkxrb5da2wn57bzfh9xn24';";

Connection conn = DriverManager.getConnection(connectionString);
ResultSet rs = conn.getMetaData().getPrimaryKeys("CData","QuickBase","SampleTable_1");
while(rs.next()){
  System.out.println(rs.getString("COLUMN_NAME"));
}

The getPrimaryKeys method returns the following columns:

Column NameData TypeDescription
TABLE_CATStringThe table catalog
TABLE_SCHEMStringThe table schema.
TABLE_NAMEStringThe table name.
COLUMN_NAMEStringThe column name.
KEY_SEQshortThe sequence number, or column index starting from 1, within the foreign key.
PK_NAMEStringThe primary key name.

Copyright (c) 2023 CData Software, Inc. - All rights reserved.
Build 22.0.8462