What is JDBC?
JDBC stands for Java Database Connectivity, is a set of Java API for accessing the relational databases from Java program. The Java API enables the programmers to execute the SQL statements against the JDBC complaint database.
JDBC allows the programmers to quickly develop small Java applications that interact with the databases.
To develop an application programmer has to:
- Develop the code to connect to the database
- Write the code to execute the query.
Once the query is successfully executed and result is retrieved from the database, programmer can read the data programmatically from the result set object.
let's know Productive & Contrary of JDBC (Pros and Cons)
Pros:
- Clean and simple SQL processing
- Good performance with large amounts of data.
- Very good for small applications
Cons:
- JDBC is not easily if it is used in large projects ( Large programming overhead)
- Transactions and concurrency must be hand-coded
- Handling the JDBC connections and properly closing the connection is also a big issue.
- No encapsulation
- Hard to maintain
- Query is DBMS specific
- Hard to implement MVC concept
What is ORM?
ORM stands for Object Relational Mapping,
the business object is directly mapped to the database tables with the help of ORM framework. ex:Hibernate /JBoos
Pros and Cons of ORM
Pros:
- No need to deal with the SQL Queries to save and retrieve the data
- Simple configuration
- Standardized API to persist the business objects
- Fast development of application
- Concurrency support
- Excellent cashing support for better performance of the application
- Injected transaction management
- Configurable logging
- Easy to learn and use
Cons:
- Slow performance in case of large batch updates
- Little slower than JDBC
No comments:
Post a Comment