Top
Symfoware Server V12.1.0 Application Development Guide
FUJITSU Software

Windows3.2.2 Registering ODBC Data Sources(for Windows)

This section describes how to register ODBC data sources.

There are the following two ways to register ODBC data sources on Windows.

3.2.2.1 Registering using GUI

This section describes how to start the [ODBC Data Source Administrator] and register ODBC data sources.

Use the following procedure to register ODBC data sources:

  1. Start the [ODBC Data Source Administrator].

    Select [Start] >> [Control Panel] >> [Administrative Tools] >> [ODBC Data Source Administrator].

    Example

    This is an example of starting [ODBC Data Sources (32-bit)] from [Administrative Tools] in Windows Server 2012.

    Note

    To register data sources for 32-bit applications in Windows(R) for 64-bit, execute the ODBC administrator (odbcad32.exe) for 32-bit, as shown below.

    %SYSTEMDRIVE%\WINDOWS\SysWOW64\odbcad32.exe

  2. When only the current user is to use the ODBC data source, select [User DSN]. When all users using the same computer are to use the ODBC data source, select [System DSN].


  3. Click [Add].


  4. Select one of the following drivers from the list of available ODBC drivers displayed in [Create New Data Source], and then click [Finish]. The notation "Vxx.y.z" indicates the version and level of the Symfoware Server client feature.

    • Symfoware Server Unicode Vxx.y.z
      Select this driver if using Unicode as the application encoding system.

    • Symfoware Server ANSI Vxx.y.z
      Select this driver if using other than Unicode as the application encoding system.

    *1: The notation "Vxx.y.z" indicates the version and level of the Symfoware Server client feature.


  5. The [PostgreSQL ANSI ODBC Driver (psqlODBC) Setup] window is displayed. Enter or select the required items, then click [Save].


    Set the following content:

    Definition name

    Setting value

    Data Source

    Specify the data source name to be registered in the ODBC driver manager. The application will select the name specified here and connect with the Symfoware Server database. This parameter cannot be omitted. Specify the following characters up to 32 bytes.

    • National characters

    • Alphanumerics

    • "_", "<", ">", "+", "`", "|", "~", "'" " "&" , """, "#" , "$" , "%" , "-" , "^" , ":" , "/" , "."

    Description

    Specify a supplementary description for the current data source. Specify characters up to 255 bytes.

    • National characters

    • Alphanumerics

    Database

    Specify the database name to be connected.

    SSLMode

    Specify to encrypt communications. The default is "disable".

    The setting values for SSLMode are as follows:

    • disable: Connect without SSL

    • allow: Connect without SSL, and if it fails, connect using SSL

    • prefer: Connect using SSL, and if it fails, connect without SSL

    • require: Connect always using SSL

    • verify-ca: Connect using SSL, and use a certificate issued by a trusted CA (*1)

    • verify-full: Connect using SSL, and use a certificate issued by a trusted CA to verify if the server host name matches the certificate (*1)

    Server

    Specify the host name of the database server to connect to, using up to 18 bytes. This parameter cannot be omitted.

    Port

    Specify the port number to be used for remote access. The default value is "26500".

    Username(*2)

    Specify the user that will access the database.

    Password(*2)

    Specify the password for the user that will access the database.

    *1: If specifying either "verify-ca" or "verify-full", use the system environment variable PGSSLROOTCERT of your operating system to specify the CA certificate file as shown below.

    Example:

    Variable name: PGSSLROOTCERT
    Variable value: cACertificateFile

    *2: In consideration of security, specify the Username and the Password by the application.

3.2.2.2 Registering using commands

This section describes how to use commands to register ODBC data sources.

Use the following tools from Microsoft to register ODBC data sources.

Refer to the Microsoft Developer Network (MSDN) Library for information on how to use these tools.

When using ODBCConf.exe

ODBCConf.exe is a tool supported on all Windows platforms.

Specification format
ODBCConf.exe /A { dataSourceType "odbcDriverName" "optionName=value[|optionName=value...]"} [/Lv fileName]

Refer to the Microsoft MSDN library for information on the format and parameters.

Description

Set the following content:

Definition name

Setting value

Data source type

Specify the data source type.

  • "CONFIGSYSDSN": A system data source is created. This requires user admin rights. The data source can be used by all users of the same computer.

  • "CONFIGDSN": A user data source is created. The data source can be used by the current user only.

Note

When CONFIGSYSDSN is specified as the data source type, it is necessary to execute the command in the command prompt in administrator mode.

ODBC driver name

Specify an ODBC driver name that has already been registered on the system.

Specify one of the following.

Note

The placeholders shown below are enclosed in angle brackets '<>' to avoid confusion with literal text. Do not include the angle brackets in the string.

  • "Symfoware Server Unicode <symfowareServerClientVersAndLvl>"
    Specify this driver name if using Unicode as the application encoding system.

  • "Symfoware Server ANSI <symfowareServerClientVersAndLvl>"
    Specify this driver name if using other than Unicode as the application encoding system.

Option name

The following items must be set:

  • "DSN": Specify the data source name.

  • "Servername": Specify the host name for the database server.

  • "Port": Specify the port number for connection to the database

  • "Database": Specify the database name.

Specify the following values as required:

  • "UID": User ID

  • "Password": Password

  • "SSLMode": Specify to encrypt communications. The default is "disable". Refer to the SSLMode explanation in the table under step 5 of "3.2.2.1 Registering using GUI" for information on how to configure SSLMode.

File Name

You can output process information to a file when creating a data source. This operand can be omitted.

Example

ODBCConf.exe /A {CONFIGSYSDSN "Symfoware Server Unicode V12.1.0" "DSN=odbcconf1|Servername=sv1|Port=26500|Database=db01|SSLMode=verify-ca"} /Lv log.txt

Note

In consideration of security, specify the UID and the Password by the application.

When using Add-OdbcDsn

Add-OdbcDsn is used in the PowerShell command interface.

Specification format
Add-OdbcDsn dataSourceName -DriverName "odbcDriverName" -DsnType dataSourceType -Platform oSArchitecture -SetPropertyValue @("optionName=value" [,"optionName=value"...])

Refer to the Microsoft MSDN library for information on the format and parameters.

Description

Set the following content:

Definition name

Setting value

Data source name

Specify any name for the data source name.

ODBC driver name

Specify an ODBC driver name that has already been registered on the system. Specify one of the following.

Note

The placeholders shown below are enclosed in angle brackets '<>' to avoid confusion with literal text. Do not include the angle brackets in the string.

  • "Symfoware Server Unicode <symfowareServerClientVersAndLvl>"
    Specify this driver name if using Unicode as the application encoding system.

  • "Symfoware Server ANSI <symfowareServerClientVersAndLvl>"
    Specify this driver name if using other than Unicode as the application encoding system.

Data source type

Specify the data source type.

  • "System": A system data source is created. Requires user admin rights. The data source can be used by all users of the same computer.

  • "User": A user data source is created. The data source can be used by the current user only.

Note

When System is specified as the data source type, it is necessary to execute the command in the administrator mode of the command prompt.

OS architecture

Specify the OS architecture of the system.

  • "32-bit": 32-bit system

  • "64-bit": 64-bit system

Option name

The following items must be set:

  • "Servername": Specify the host name for the database server.

  • "Port": Specify the port number for connection to the database

  • "Database": Specify the database name.

Specify the following values as required:

  • "SSLMode": Specify to encrypt communications. The default is "disable". Refer to the SSLMode explanation in the table under step 5 of "3.2.2.1 Registering using GUI" for information on how to configure SSLMode.

Note

When using Add-OdbcDsn, the strings "UID" and "Password" cannot be set as option names. These can only be used when using ODBCConf.exe.

Example

Add-OdbcDsn odbcps1 -DriverName "Symfoware Server Unicode V12.1.0" -DsnType System -Platform 32-bit -SetPropertyValue @("Servername=sv1", "Port=26500", "Database=db01", "SSLMode=verify-ca")