Skip to main content

Generic_JDBC_Connection.connect

Generic_JDBC_Connection.connecturlpropertiesquote_char

Documentation

Connect to a database specified by a JDBC URL.

Arguments

  • url: The JDBC URL describing the database to connect to.
  • properties: A vector of properties for the connection.
  • quote_char: The character used to quote identifiers. If empty, the driver default is used.

Examples

Connect to an H2 database instance. (This requires that you have the H2

JDBC driver in your classpath.)

      connection = Generic_JDBC_Connection.connect "jdbc:h2:~/my_database"

Remarks

Using JDBC Drivers

Generic_JDBC_Connection is a wrapper around a JDBC Connection. This can be used to access any JDBC-compliant database backend, including ones that do not have full support via Connections. It provides schema information, and the ability to execute SQL queries and commands.

Unlike regular fully-supported Connections, query results are returned as in-memory Tables, rather than as DB_Tables.

The JDBC driver must be available on the JVM classpath (for example, in a polyglot/java folder within the project). JDBC drivers can only be used in JVM mode.