Posts

Showing posts from November, 2012

JDBC versus ODBC and other APIs

At this point, Microsoft's ODBC (Open DataBase Connectivity) API is probably the most widely used programming interface for accessing relational databases. It offers the ability to connect to almost all databases on almost all platforms. So why not just use ODBC from Java? The answer is that you  can  use ODBC from Java, but this is best done with the help of JDBC in the form of the JDBC-ODBC Bridge, which we will cover shortly. The question now becomes, "Why do you need JDBC?" There are several answers to this question: ODBC is not appropriate for direct use from Java because it uses a C interface. Calls from Java to native C code have a number of drawbacks in the security, implementation, robustness, and automatic portability of applications. A literal translation of the ODBC C API into a Java API would not be desirable. For example, Java has no pointers, and ODBC makes copious use of them, including the notoriously error-prone generic pointer "void *"

Thin & OCI Drivers

Oracle provides two main types of drivers. The OCI driver. The OCI (type 2) driver consists of java wrappers to the low-level Oracle Call Interface (OCI) libraries used by utilities like SQL*Plus to access the database server. The OCI driver offers potentially better performance that the thin driver. It however requires the OCI libraries to be installed on the local machine. The "thin" driver. Also referred to as type 4 driver, the thin driver is a pure Java implementation of Oracle's networking protocol (Net8). Being self-contained, it may be used on any machine with--or without Oracle installed--or even distributed with application classes in an applet.

ClientAbortException java.net.SocketException Broken Pipe

Symptoms: The following error appears in the logs: WARNING : Exception Processing ErrorPage[errorCode=500, location=/500page.jsp] ClientAbortException: java.net.SocketException: Broken pipe   WARNING : Exception Processing ErrorPage[errorCode=404, location=/fourohfour.action] ClientAbortException: java.net.SocketException: Broken pipe Cause: The warning log basically means that the connection to the client browser is  aborted before the response is fully transferred. It is a harmless warning as  it can be due to transient network problems or the browser aborts/refreshes the  page before it loaded.