123ArticleOnline Logo
Welcome to 123ArticleOnline.com!

ALL >> Computer-Programming >> View Article

Introduction Of Java Jdbc

By Author: The Best Institute to Learn Java Training in Banga
Total Articles: 37

What is API Programming interface (Application programming interface) is a report that contains depiction of the extensive number of components of a thing or programming. It addresses classes and interfaces that item activities can bring after to talk with each other. An API can be made for applications, libraries, working structures, et cetera .. Pushed JAVA Training in bangalore JDBC Driver JDBC Driver is an item fragment that enables java application to interface with the database.
There are 4 sorts of JDBC drivers:
1. JDBC-ODBC interface driver
2. Native-API driver (for the most part java driver)
3. Network Protocol driver (totally java driver)
4. Thin driver (totally java driver)
1) The ODBC driver ought to be presented on the client machine.
2) Native-API driver The Native API driver uses the client side libraries of the database. The driver changes over JDBC procedure calls into nearby calls of the database API. It isn't made absolutely in java. Ideal position:
performance refreshed than JDBC-ODBC associate driver. Weight:The Native driver ought to be presented on the each client machine. The Vendor client library ought to be presented on client machine. 3) Network Protocol driver The Network Protocol driver uses middleware (application server) that converts JDBC calls clearly or roundaboutly into the trader specific database tradition. It is totally formed in java. Favored stance: No client side library is required in light of usage server that can perform numerous errands like looking at, stack modifying, logging et cetera. Weaknesses:
Network reinforce is required on client machine.Requires database-specific coding to be done in the inside level. Maintenance of Network Protocol driver ends up being over the top in light of the way that it requires database-specific coding to be done in the middle level. 4) Thin driver The thin driver changes over JDBC calls particularly into the trader specific database tradition. That is the reason it is known as thin driver. It is totally formed in Java vernacular. Good position:
Better execution than each and every other driver. No writing computer programs is required at client side or server side. Injury: Drivers depends upon the Database. 5 Steps to interface with the database in java There are 5 phases to interface any java application with the database in java using JDBC. They are according to the accompanying: Register the driver class
• Creating affiliation
• Creating clarification
• Executing questions
• Closing affiliation
Register the driver class The forName() procedure for class is used to enroll the driver class. This technique is used to capably stack the driver class. Accentuation of forName() methodology open static void forName(String className)throws ClassNotFoundException 2) Create the affiliation challenge The getConnection() technique for DriverManager class is used to develop relationship with the database. 1) open static Connection getConnection(String url)throws SQLException 2) open static Connection getConnection(String url,String name,String mystery word) hurls SQLException 3) Create the Statement dissent The createStatement() system for Connection interface is used to make enuncia
The topic of decree is fit to execute request with the database. open Statement createStatement()throws SQLException 4) Execute the request The executeQuery() procedure for Statement interface is used to execute request to the database. This procedure reestablishes the topic of ResultSet that can be used to get each one of the records of a table. open ResultSet executeQuery(String sql)throws SQLException 5) Close the affiliation challenge By closing affiliation dissent enunciation and ResultSet will be closed normally. Best core java training in Bangalore

The adjacent() methodology for Connection interface is used to close the affiliation. Phonetic structure of close() methodology open void close()throws SQLException Case to interface with the Oracle database in java For interfacing java application with the prophet database, you need to take after 5 phases to perform database organize. For this situation we are using Oracle10g as the database. So we need to know following information for the prophet database:
Driver class: The driver class for the prophet database is oracle.jdbc.driver.OracleDriver. Connection URL: The affiliation URL for the oracle10G database is jdbc:oracle:thin:@localhost:1521:xe where jdbc is the API, prophet is the database, thin is the driver, localhost is the server name on which prophet is running, we may in like manner use IP address, 1521 is the port number and XE is the Oracle advantage name.
You may get every one of these information from the tnsnames.ora record. Username: The default username for the prophet database is structure. Password: Password is given by the customer at the period of presenting the prophet database. Two ways to deal with stack the compartment record: 1.paste the ojdbc14.jar report in jre/lib/ext envelope 2.set classpath 1) stick the ojdbc14.jar record in JRE/lib/ext coordinator: Initially, look through the ojdbc14.jar archive by then go to JRE/lib/ext envelope and paste the compartment record here. 2) set classpath: There are two ways to deal with set the classpath:
• temporary • permanent

Total Views: 18Word Count: 1071See All articles From Author

Computer Programming Articles

1. A Manual For Automation Testing Frameworks
Author: Siyaram Ray

2. Php Advantages And Its Particular Reference To Seo Services
Author: Rohit Sharma

3. 4 Reasons To Learn Javascript
Author: priya

4. Kunsh Technologies - Outsource Web Development Company
Author: Darshan Shah

5. Ui Test Automation Best Practices You Should Follow
Author: Siyaram Ray

6. Send Bulk Sms Gateway Api
Author: I am associated with msgclub as a business development executive and like to know more about BULK SM

7. Php Framework Inbuilt Capacities For Developers.
Author: Infocampus logics pvt ltd

8. Full Stack Developer Training In Bangalore
Author: rpahome

9. Android App Development Course In Mumbai
Author: prashant

10. Learn Selenium – Some Useful Hints
Author: Siyaram Ray

11. Importance Of Selenium Training With Java In Bangalore
Author: Siyaram Ray

12. Detail Portrayal About Java Collections
Author: There are huge number of institutes for Java in B

13. Selenium For Automated Website Testing
Author: Siyaram Ray

14. 10 Steps To Become An Outstanding Java Developer
Author: The Best Institute to Learn Java Training in Banga

15. New Planet Defender Game
Author: Planet Defender Game

Login To Account
Login Email:
Password:
Forgot Password?
New User?
Sign Up Newsletter
Email Address: