Java Series--JDBC Connect Oracle

Source: Internet
Author: User

JDBC Connection Database

Jndi Connection Pool

JDBC Driver package: Used to connect Oracle, it is provided by Oracle itself, directory D:\app\Administrator\product\11.2.0\dbhome_1\jdbc\ Lib under ojdbc6.jar--copy the driver package to the project's Lib folder

Right-click Project name--build path--Configure build Path--java build Path--libraries--add jars--Select Project Lib folder Ojdbc6.jar

MyEclipse DataBase Explorer-MyEclipse Derby-Right-click New--database driver complete configuration--test driver succeeded-copy connection URL to notepad--copy driver classname to Notepad at the same time

java.sql interface Connection---Connection to a specific database (session)

The principle of using database connection:

Open late, early off---purpose is to conserve resources

Interface Statement executes a static SQL statement---and returns

---executeQuery executes the given SQL statement, the statement returns a single ResultSet object

Interface ResultSet---a data table that represents a database result set, typically generated by executing statements that query the database.

Transaction (Transaction): Acid Properties

Multi-step operation on the database while successfully and simultaneously failing

Oo thought: SRP/OCP

Core idea: Three Layer development UI-->> Biz-->> DAO Call relationship

1, a UI method is best to tune only a biz public method

2. The public method of a biz can invoke multiple methods of multiple DAO

Java Series--JDBC Connect Oracle

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.