PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Overview
  • Setup
  • Configuration
  • To use the ODBC driver on HFSQL, configure the ODBC driver:
  • Use
  • Using the ODBC driver on HFSQL from your Java program
  • Known problems
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Using ODBC on HFSQL Classic via J++ and JDBC
ODBCHFSQLAvailable only with these kinds of connection
Overview
The ODBC driver on HFSQL Classic is used to access a HFSQL Classic database from an external database software that supports ODBC accesses. This gives you the ability to use the ODBC driver on HFSQL via J++ and JDBC.
You must use:
  • the Microsoft or Sun JDBC driver.
  • Sun JDK or Visual J++.
The driver is available in read/write. An application written in external language can read and write in HFSQL files.
The ODBC driver on HFSQL Classic is a level 2 ODBC driver. See a specific documentation for more details.
Note: From version 19, HFSQL is the new name of HyperFileSQL.

Setup

When installing WINDEV and WEBDEV on the development computer, you have the ability to install the ODBC driver on HFSQL Classic.
Furthermore, when configuring the setup program of your WINDEV applications, you have the ability to include the setup of the ODBC driver on HFSQL.
Configuration

To use the ODBC driver on HFSQL, configure the ODBC driver:

  1. Start the administrator of ODBC data (ODBCAD32.EXE) on your computer. To do so, select "Start .. Run" from Windows and type "ODBCAD32.EXE".
  2. Select the "User database" tab.
  3. Click the "Add" button.
  4. Select the "HyperFileSQL" driver.
  5. Click "Done".
  6. Enter the name of the HFSQL data source. This name will be used to identify the HFSQL database in the external programs.
  7. Click the "Details" button.
  8. Click "Browse" to select the WDD file corresponding to the analysis.
  9. In the list of analyses, select the requested analysis and the directory of the data files ("Browse" button). All the HFSQL data files corresponding to the selected analysis are grouped in this directory.
    Caution: a file directory must be selected for each analysis.
  10. Validate ("OK" button).
The database can be used in read-only mode from the external programs via the ODBC driver on HFSQL Classic.
Use

Using the ODBC driver on HFSQL from your Java program

To use the ODBC driver on HFSQL from your Java program, you must:
  1. Define the driver used. For example, with the following code line:
    // Use the JDBC driver of Microsoft
    Class.forName("com.ms.jdbc.odbc.JdbcOdbcDriver");
    // Use the JDBC driver of Sun
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  2. Define the URL on the system ODBC connection ("hfodbc" for example):
    String jURL = "jdbc:odbc:hfodbc";
    // Connection
    Connection Contact = DriverManager.getConnection(jURL, "<user>", "<pass>");
  3. Interrogate the HFSQL database in SQL. For example:
    // Creates a query
    Statement jQuery = Contact.createStatement();
    // Run the query and retrieve ...
    ResultSet Result = jQuery.executeQuery("SELECT * FROM CUSTOMER");
    int jColumn = 5;
    int jRow = 3;
    ResultSetMetaData jMetaData= Result.getMetaData();
    for (int i=0;i<jRow;i++)
    Result.next();
    System.out.println("Column name: " + jMetaData.getColumnLabel(jColumn));
    System.out.println("Value: " + Result.getString(jColumn));
    Result.close();
    jQuery.close();
    Contact.close();
Known problems
The ODBC driver on HFSQL cannot be used to access an encrypted HyperFileSQL database.
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment