AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Administrar bases de datos / Acceso mediante ODBC u OLE DB
  • 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
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Using ODBC on HFSQL Classic via JDBC
ODBCHFSQL ClassicDisponible solo con estos tipos de conexión
Overview
The ODBC driver on HFSQL Classic is used to access an 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 JDBC.
It is necessary to use a JDBC driver (Microsoft, Oracle, etc.).
The driver is available in read/write. An application written in an external language can read and write in HFSQL data files.
The ODBC driver on HFSQL Classic is a level 2 ODBC driver. For more details, see a specific documentation.

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 ODBC data administrator (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 "Finish".
  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. Confirm ("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 line of code:
    // 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.
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 02/05/2025

Señalar un error o enviar una sugerencia | Ayuda local