jobs4timesLogo jobs4timesLogo

JDBC Draw Backs

Agenda :
Draw Backs of JDBC :
  1. In JDBC, to establish a simple database connection also, we need to write that code inside try block. And if any exceptions raised then we need to handle those exceptions inside catch block. Here try and catch blocks are mandatory.
  2. After performing our required task, as a programmer we must close the connection manually, otherwise we may get out of connection error at runtime. Closing the connection and other resource-reallocating code we need to write inside finally block.
  3. If we are not closing the connection manually then JDBC is not responsible to close the connection automatically.
  4. After developing the JDBC program, if there is any changes occurred in the database table structure, then our JDBC program doesn't work because we will write static SQL Queries inside program.
    So we need to rewrite the SQL commands according to the latest table structure. The re-compilation and re-deployment is mandatory.
  5. Because of static SQL queries, JDBC will make our applications as database dependent. If we change the database then our applications doesn't work.
  6. In JDBC, while retrieving the data from database, we will get that data in the form of ResultSet. Programmer is responsible to cover the data from ResultSet into our required objects.
  7. JDBC will generate database specific exceptions and errors which are not familiar to java programmers.
  8. In an Enterprise application, the data flow from one layer to another layer will be in the form of objects, but finally while transferring the object(data) from Data-Access layer to database, that object has to convert into text. Because JDBC cannot transfer the objects directly into the database.