On this page

DBParam

DBParam Type (Client API)

Client API

DBParam is used to set the several parameters to get the BangDB Environment. Some of the parameters are host ip, port, ssl/non-ssl, transaction type etc. Client connecting with each different DBs will have separate DBParams

C++

Java

To get the DB Param environment

 DBParam(); 
To set Host IP
 void setHost(const char *host); 
To set port on which server will be running
 void setPort(const char *port); 
To set path to bangdb.config file
 void setDbConfigPath(const char *dbconfigPath); 
To set path where db files will be kept
 void setDbPath(const char *dbPath); 
To set path where log files will be kept
 void setLogPath(const char *logPath); 
To set path where archive files will be kept
 void setArchivePath(const char *archivePath); 
To open db in transactional or non-transactional mode
 void setTransactionType(TransactionType tranType); 
TransactionType is an enum with following options:

DB_TRANSACTION
DB_OPTIMISTIC_TRANSACTION
DB_PESSIMISTIC_TRANSACTION
To set for sock connection
 void setInitSockConn(bool flag); 
This is to specify if we need to init the socket connection.

To set secure connection
 void setSecureConn(bool flag); 
To get Host IP address
 const char *getHost(); 
User should free the returned data using delete[]

To get host port
 const char *getPort(); 
User should free the returned data using delete[]

To get location of bangdb.config file
 const char *getDbConfigPath(); 
User should free the returned data using delete[]

To get location of DB files
 const char *getDbPath(); 
User should free the returned data using delete[]

To get location of log files
 const char *getLogPath(); 
User should free the returned data using delete[]

To get location of archive files
 const char *getArchivePath(); 
User should free the returned data using delete[]

To get the transaction type
 TransactionType getTranType(); 
TransactionType is an enum with following options:

DB_TRANSACTION
DB_OPTIMISTIC_TRANSACTION
DB_PESSIMISTIC_TRANSACTION

To check sock connection
 bool getInitSockConn(); 
To check for secure connection
bool getSecureConn();

DBParam is used to set the several parameters to get the BangDB Environment.
Some of the parameters are host ip, port, ssl/non-ssl, transaction type etc. Client connecting with each different DBs will have separate DBParams
To get status for verification for DB parameters

 public boolean get_just_verify() 
To verify DB parameters
 public void set_just_verify(boolean just_verify) 
To check for sock connections
 public boolean get_init_sock_conns() 
This returns boolean that represent init the socket connection

To set sock connection
 public void set_init_sock_conns(boolean _init_sock_conns) 
This is to specify if we need to init the socket connection

To check for tls connection
 public boolean get_is_tls_conn() 
To set tls connection
 public void set_is_tls_conn(boolean _is_tls_conn) 
This is the set whether to use ssl/tls based secure channel or not.

To get Host IP address and Port
 public String get_host() public String get_port() 
To set Host IP and Port
 public void set_host(String _host) public void set_port(String _port) 
To get user id
 public String get_userid() 
To set user id
 public void set_userid(String _userid) 
To get password
 public String get_pwd() 
To set password
 public void set_pwd(String _pwd) 
To get location of log files
 public String get_archivePath() 
To set path where archive files will be kept
 public void set_archivePath(String _archivePath) 
To set path where DB files will be kept
 public void setDBPath(String dbPath) 
To get location of DB files
 public String getDBPath() 
To set path where log files will be kept
 public void setLogPath(String logPath) 
To get location of log files
 public String getLogPath() 
To set path to bangdb.config file
 public void setDBConfigPath(String dbconfigPath) 
To set client config file path
 public void setClientConfigPath(String clconfigPath) 
To get location of bangdb.config file
 public String getDBConfigPath() 
To get path location of client config file
 public String getClientConfigPath() 
To set transaction type
 public void setTransactionType(TransactionType tranType) 
TransactionType is an enum with values

DB_MULTIOPS_TRANSACTION_NONE,
DB_OPTIMISTIC_TRANSACTION,
DB_PESSIMISTIC_TRANSACTION

Please see more on this at bangdb common
To get the Transaction type set
 public TransactionType getTransactionType() 

 

 

Was this article helpful to you? Yes No