BearDB Database Clients

This part of the documentation covers the setup and use of the BearDB database clients.

There are five database clients available for BearDB:

    Command-line client
    BearDBClient3 for C# .NET
    BearDBClient3 for Java
    JDBC Driver
    ADO.NET Driver

BearDB can also support web-based applications via its REST Server.
For more information on the BearDB REST Server, checkout the documentation link above.
The documentation for the Command-line client can be found here.


BearDBClient3 for C# .NET

BearDB is delivered with a C# .NET API client. This client allows someone to make queries from a C# program and retrieve the results in a class instance that represents a data set, or as a set of comma-separated values.

The C# client communicates with the BearDB database server using a TCP-IP port. Therefore the client can be located on any system that can communicate via a TCP-IP port with the database server.
To use the C# client in an application you will need to include the file BearDBClient3.dll as a reference in your C# application or library. The file comes with distribution of BearDB.

To use the C# client you will want to reference the API documentation to understand how it works. Create an instance of the C# clent class with the correct user name, pass value, server name, and port number. Once this instance has been created it can be reused for multiple queries.

BearDBClient3 for Java

BearDB is delivered with a Java-based API client. This client allows someone to make queries from a java program and retrieve the results in a class instance that represents a data set, or as a set of comma-separated values.

The Java client communicates with the BearDB database server using a TCP-IP port. Therefore the Java client can be located on any system that can communicate via a TCP-IP port with the database server.
To use the Java client in an application you will need to include the file BearDBClient3.jar in your classpath. The file comes with distribution of BearDB.

To use the Java client you will want to reference the API documentation to understand how it works. Create an instance of the C# clent class with the correct user name, pass value, server name, and port number. Once this instance has been created it can be reused for multiple queries.

A code sample that executes a simple SELECT query using either BearDB client is as follows:

     BearDBClient dbClient = new BearDBClient(userName, passValue, "servername", 7169);
     BearDBRow[] dbRows = null;

     try
     {
          String sql = "SELECT * From myTable where col2='the value'";
          dbRows = dbClient.executeQuery(sql);
     }
     catch (BearDBAuthorizationException authex)      {
          // an error occurred authorizing the user
          System.out.println(authex.getMessage());
     }
     catch (BearDBConnectException connex)
     {
          // an error occurred connecting to, or communicating with the server
          System.out.println(connex.getMessage());
     }
     catch (BearDBSqlException sqlex)
     {
          // an error occurred processing the SQL statement
          System.out.println(sqlex.getMessage());
     }
     catch (BearDBInvalidOperationException invalidex)
     {
          // the SQL statement content did not match the method
          System.out.println(invalidex.getMessage());
     }

There are two types of return values that you can get as the result of a select query.
When you use the executeQuery() method you will get back an array of objects of type BearDBRow that represent the rows returned from a table or query.
When you use the executeQueryCSV() method you will get back a string object that represents the query result as a comma-separated set of values with the column names listed in the first row. The content of the string returned by the executeQueryCSV() method looks similar to the following:

    LastName,FirstName,OrderNo
    Hansen,Ola,22456
    Hansen,Ola,24562
    Pettersen,Kari,77895
    Pettersen,Kari,44678

    4 Rows.

BearDBjdbc JDBC Driver

The BearDB Database comes with a Type-4 JDBC driver for use in multithreaded Java applications.

The JDBC driver can also be used with a Database Management or SQL Query application to facilitate the administration of BearDB database instances.

Driver Libraries:
The following jar files comprise the BearDBjdbc driver:

  • BearDBClient3.jar
  • BearDBjdbc3.jar

Both files must be in the classpath for the JDBC driver to work properly.

Driver Connection String:
The driver connection string follows the jdbc convention:

prefix://[serverName]:[portNumber][;[parameter=value];[parameter=value]]

A sample of the BearDBjdbc driver connection string looks like this:

jdbc:beardb://serverOrIpAddr:7169;username=dbAdmin;password=changeMe00;encrypt=false

The BearDBjdbc driver only accepts these parameter values:

  • username: The database username or login
  • password: The password for the supplied username or login
  • encrypt: Client-to-server communications are encrypted if this is set to a value of 'true'. Any other value, or a lack of a value is defaulted to 'false' and communications will not be encrypted.

Driver Class:


The BearDBjdbc3 driver class is as follows:

   org.beardata.beardbjdbc3.driver.BearDBDriver


The BearDB ADO.NET client


BearDB is delivered with a C#-based ADO.NET database client. This client allows someone to make queries from a C# program and retrieve the results in a class instance that represents a data set, or as a set of comma-separated values.

The ADO.NET client communicates with the BearDB database server using a TCP-IP port. Therefore the C# client can be located on any system that can communicate via a TCP-IP port with the database server.
To use the ADO.NET client in an application you will need to reference the BearDBADO32.dll libnrary. The file comes with distribution of BearDB.

The ADO.NET client depends on BearDBClient3.dll, which is included with a distribution of BearDB.