Top
Symfoware Server V12.0.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.

Note

The GUI cannot be used to register the data source for 64-bit applications on Windows 8 for x64 and Windows Server 2012.

Refer to "3.2.2.2 Registering using commands" to perform the tasks for registering.

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 XP for x64, Windows 8 for x 64, Windows Server 2003 x 64 Editions, Windows Server 2008 for x 64, Windows Server 2008 R2, and Windows Server 2012, 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. In the [Create New Data Source] window, select either "Symfoware Server ANSI V12.0" or "Symfoware Server Unicode V12.0" from the list of available ODBC drivers and then click [Finish].

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

    The windows for "Symfoware Server ANSI V12.0 and "Symfoware Server Unicode V12.0" are the same, but the initial values for data source names are as follows:

    • Symfoware Server ANSI V12.0: "PostgreSQL30"

    • Symfoware Server Unicode V12.0: "PostgreSQL35W"

    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: caCertificateFileStorageDir/root.crt

    *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:

Tool

OS

ODBCConf.exe

Windows XP
Windows Vista
Windows 7
Windows 8
Windows Server 2003
Windows Server 2003 R2
Windows Server 2008
Windows Server 2008 R2
Windows Server 2012

Add-OdbcDsn

Windows 8
Windows Server 2012

The following describes the two ways to register ODBC data sources. Refer to MSDN for information on how to use the commands and for the descriptions of the parameters.

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:

  • "Symfoware Server Unicode V12.0"

  • "Symfoware Server ANSI V12.0"

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.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 data source name -DriverName "ODBC driver name" -DsnType data source type -Platform OS architecture -SetPropertyValue @("option name=value" [,"option name=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:

  • "Symfoware Server Unicode V12.0"

  • "Symfoware Server ANSI V12.0"

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.0" -DsnType System -Platform 32-bit -SetPropertyValue @("Servername=sv1", "Port=26500", "Database=db01", "SSLMode=verify-ca")