Using ODBC or JDBC Drivers To Connect

Starting from WinSQL version 19, you can connect to your back-end database using either the JDBC or the ODBC drivers - your choice.

Benefits of Having a Choice

You can choose to use ODBC or JDBC. Although you will most likely be able to connect to your backend database with either technology, there are instances when you should choose one over the other. For example:

  • Some databases are only available in Java, such as Apache Derby, and HyperSQL.
  • Similarly, you must use ODBC to write a query against Plain Text Files.
  • There is a slight performance benefit when using ODBC because an ODBC driver resides inside a compiled DLL, compared to Java, which is interpreted at runtime. However, this difference is almost negligible on modern high-speed computers.
  • The driver's availability will often dictate the technology you must use.

Connecting To Your Database

In ODBC and JDBC, you must create a Data Source Name (DNS) before connecting to the database. A DNS defines the following:

  • A friendly name for the data source
  • The driver you are going to use. In case of ODBC, this is a DLL, and it is a JAR file in case of JDBC.
  • Connection parameters, such as server's hostname, TCP/IP port number, encryption properties, and more.

The following screen displays the connection window in WinSQL, displaying both ODBC and JDBC data sources.

The screenshot above displays a list of data sources available on your system. Each name is prefixed by Jdbc or Odbc, signifying the type of driver you will be using.

Navigation

Social Media

Powered by 10MinutesWeb.com