JDBC Driver for Microsoft Dynamics CRM

Build 25.0.9434

カラム

DatabaseMetaData インターフェースのgetColumns メソッドを使用して、カラム情報を取得できます。 結果は、テーブル名に基づいて制限できます。 次のコード例は、Lead テーブルのカラム名を取得します。

String connectionString = "jdbc:dynamicscrm:User=myuseraccount;Password=mypassword;URL=https://myOrg.crm.dynamics.com/;CRM Version=CRM Online;";

Connection conn = DriverManager.getConnection(connectionString);
DatabaseMetaData table_meta = conn.getMetaData();
ResultSet rs = table_meta.getColumns(null,null,"Lead", null);
while(rs.next()){
  System.out.println(rs.getString("COLUMN_NAME")); 
}
getColumns メソッドは次のカラムを返します。

By default, the driver introduces a generic column named Id for each table to provide a consistent reference to the entity's primary key across the schema. This alias corresponds to the actual primary key field in the Microsoft Dynamics CRM system.

If you prefer to work with the original schema-defined names, set UseSchemaNames to True in your connection string. This exposes fields using their API names (for example, ContactId). Alternatively, if you enable UseDisplayNames, the columns display using their user-friendly names as defined in the CRM UI (for example, Contact).

NOTE: Only one of these options can be used at a time, as UseSchemaNames and UseDisplayNames are mutually exclusive.

カラム名データ型説明
TABLE_CATStringデータベース名。
TABLE_SCHEMStringテーブルスキーマ。
TABLE_NAMEStringテーブル名。
COLUMN_NAMEStringカラム名。
DATA_TYPEintjava.sql.Types で定義されている定数値によって識別されるデータ型。
TYPE_NAMEString本製品 によって使用されるデータ型名。
COLUMN_SIZEintカラムの文字数単位の長さ、または数値精度。
BUFFER_LENGTHintバッファ長。
DECIMAL_DIGITSintカラムのスケール(小数点以下の桁数)。
NUM_PREC_RADIXint基数。
NULLABLEintカラムに、次のJDBC DatabaseMetaData 定数で定義されているnull を含めることができるかどうか:parameterNoNulls (0) またはparameterNullable (1) 。
REMARKSStringカラムの説明。
COLUMN_DEFStringカラムのデフォルト値。
SQL_DATA_TYPEint仕様で予約されています。
SQL_DATETIME_SUBint仕様で予約されています。
CHAR_OCTET_LENGTHintバイナリおよび文字ベースのカラムの最大長。
ORDINAL_POSITIONint1から始まるカラムインデックス。
IS_NULLABLEStringNull 値が許可されるかどうか(YES またはNO)。
SCOPE_CATALOGString参照属性の範囲となるテーブルカタログ。
SCOPE_SCHEMAString参照属性の範囲となるテーブルスキーマ。
SCOPE_TABLEString参照属性の範囲となるテーブル名。
SOURCE_DATA_TYPEintDISTINCT 型のソース型。または、ユーザー生成Ref 型。DATA_TYPE がDISTINCT でない場合、この値はnull になります。ユーザー生成Ref の場合、この値はnull になります。
IS_AUTOINCREMENTStringMicrosoft Dynamics CRM によってカラムに固定増分値が割り当てられるかどうか。
IS_GENERATEDCOLUMNString生成されたカラムであるかどうか(YES またはNO)。

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434