How to Configure GBase 8s ODBC Data Source on Windows?

Published on 2021-02-01

1. Configure Setnet32

(1) Open the "GBase Client-SDK 4.10 (64-bit)" program group in the Windows Start menu, and click Setnet32.

(2) Fill in the relevant information of the GBase 8s Server in the pop-up interface.

● Fill in the relevant information in Server Information, where:

GBase 8s Server: Enter the database service name on the database server. This service name can be obtained by checking the $GBASEDBTSERVER environment variable of the gbasedbt user or the DBSERVERNAME parameter in the onconfig configuration file.

HostName: The IP address of the database server.

Protocolname: Select onsoctcp.

Service Name: The database service port number, which can be viewed by executing the onstat -g ntt command on the database server.

After configuration, click Make Default Server to set it as the default server, then click Apply.

● Fill in the relevant information in Host Information, where:

Current Host: Enter the IP address of the database server.

User Name: Enter gbasedbt.

Password Option: Select password.

Password: Enter the password of the gbasedbt user on the database server.

After configuration, click Apply.

 

2. Test Connection

(1) Open the "GBase Client-SDK 4.10 (64-bit)" program group in the Windows Start menu, and click ConnecTest Demo.

(2) Fill in the relevant connection information in the pop-up interface:

Server: Enter the name defined in Setnet32, here it is GBS320.

Host: The IP address of the database server.

Service: The database service port number.

Protocol: Select onsoctcp.

User Name: Enter gbasedbt.

Password: Enter the password of the gbasedbt user on the database server.

Database: Select the database for testing.

Query: Enter the test statement, usually a simple SELECT statement.

After filling in, click Execute. If the connection is successful, the execution result of the SQL statement in Query will be displayed in the Query Result.

If the execution fails, there is an error in the previous configuration. You need to check the settings in Setnet32 or ConnectTest Demo.


 

3. Configure ODBC

(1) Open the "Windows Administrative Tools" program group in the Windows Start menu, and click "ODBC Data Sources (64-bit)".

(2) In the pop-up "ODBC Data Source Administrator (64-bit)" window, switch to the "User DSN" tab:

Click "Add" to open the "Create New Data Source" window. Select "GBase ODBC DRIVER (64-bit)" and click Finish.

(3) Configure DSN:

In the General tab, enter Data Source Name:

In the Connection tab, enter the relevant information. After completion, click "Apply & Test Connector" to verify the ODBC connection.

After the test passes, click "OK" to save the settings.

The MyDSN defined in the above step is the ODBC data source name referenced in the application.