Skip to end of metadata
Go to start of metadata

ORACLE

Sample Code

ALTIBASE

Sample Code

  • APRE doesn't support a syntax like "ALTER AUTHORIZATION".
  • APRE doesn't support a syntax like "IN {SYSDBA | SYSOPER} MODE".
  • APRE doesn't support a functionality for auto-connection.

Using AT

When you need to connect multiple database connections, use "AT" in your application source.

We recommend you to use independent connection name using AT clause for each connections.

  • ALTIBASE HDB doesn't provide context for multi-thread application. Therefore, User has to manage connections for multi-thread application.

Using connect_string

When you need to specifiy a target database, use "USING" in your application source.

Option

Meaning

DSN

To specify IP of database server.

PORT_NO

To specify PORT_NO of database server.

NLS_USE

To specify national character set of database server.

CONN_TYPE

To specify connection-type.

  • CONN_TYPE=1 : TCP/IP type
  • CONN_TYPE=2 : UNIX Domain Socket type
  • CONN_TYPE=3 : IPC type (use shared-memory area for communication buffer.)

TIMEOUT=n

To specify time-limitation of interval for trying to connect to DB-server.

CONNECTION_TIMEOUT=n

To specify time-limitation of interval for receiving a packet about result of SQL executed.

  • If you don't specify a connection_string, application tries to connect to a local-server.
  • TIMEOUT and CONNECTION_TIMEOUT are used to check immediately a network-error in your application.
  • You can set a OS user-environment variable to connect to a database.

FailOver on application-side

AlTIBASE HDB provides functionality to fail-over, we called it as CTF and STF.
CTF is an acronym of Connection-Time-Failover and STF means Service-Time-Failover.
CTF is used when application tries to connect to a DBMS and gets an error for connection, application automatically tries to connect to an other DBMS which user defined.
STF is a available when application tries to execute a SQL and gets an connection-error (as DBMS or Server was down) for connection, application automatically tries to connect to an other DBMS which user defined.

Sample Code-1

If fail to connect to "192.168.3.54", application automatically tries to connect to "192.168.3.53" after 5 seconds.

Sample Code-2


In the code above, When execute a insert-SQL, STF happens.
If user uses STF-functionality, User has to check a error-code as "EMBEDED_ALTIBASE_FAILOVER_SUCCESS".
STF functionality doesn't replay a transaction before failover, only reconnect to other server without having session-related information.
Therefore, user needs to write an additional code to replay.

Properties

Description

AlternateServers

User describes target-servers when connection-error happened.

ConnectionRetryDelay

After this time(second) elapses, application tries to connect to other server.

SessionFailOver

User defines to use STF-functionality or not

  • No labels