Java C8. JDBC

‘’ and ‘’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the package. JDBC Driver API defined for connecting between the JDBC driver manager and JDBC drivers JDBC Driver access each database 4 types : JDBCODBC bridge Native API partly – Java technologybased driver Netprotocol all Java technologybased driver | Chapter 8. JDBC ITSS Java Programming NGUYEN Hong Quang, HUT Components of JDBC JDBC 1 JDBC API ‘’ and ‘’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the package JDBC JDBC Driver API defined for connecting between the JDBC driver manager and JDBC drivers JDBC Driver access each database 4 types : JDBC-ODBC bridge Native API partly – Java technology-based driver Net-protocol all - Java technology-based driver Native-protocol Java technology-based driver Setting classpath for JDBC Driver class as a archive file: classpath=% classpath %;C:\mysql\ ; Driver class as a directory: classpath=% classpath %;C:\mysql\classes; Copy class/zip/jar file into directory “ext” DbEdit plug-ins : install Edit database directly in Eclipse Activate DbEdit Connecting DbEdit with MySQL Editing Database with DBEdit Database structure Database data | Chapter 8. JDBC ITSS Java Programming NGUYEN Hong Quang, HUT Components of JDBC JDBC 1 JDBC API ‘’ and ‘’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the package JDBC JDBC Driver API defined for connecting between the JDBC driver manager and JDBC drivers JDBC Driver access each database 4 types : JDBC-ODBC bridge Native API partly – Java technology-based driver Net-protocol all - Java technology-based driver Native-protocol Java technology-based driver Setting classpath for JDBC Driver class as a archive file: classpath=% classpath %;C:\mysql\ ; Driver class as a directory: classpath=% classpath %;C:\mysql\classes; Copy class/zip/jar file into directory “ext” DbEdit plug-ins : install Edit database directly in Eclipse Activate DbEdit Connecting DbEdit with MySQL Editing Database with DBEdit Database structure Database data Attribute properties Execute SQL command with DbEdit JDBC Programming procedure JDBC Driver Loading Connecting to database Making of SQL Statement Execution of SQL Statement Operation of ResultSet Closing of connection () () () () Loading of JDBC driver Public static class (String className) throws ClassNotFoundException JDBC driver is described by ClassName : Create an instance of this class to load JDBC driver Loading of JDBC driver : Exemple Exemple : Loading JDBC driver of MySQL database try { (""); } catch (ClassNotFoundException e){ (“Do not connect"); } Note : set CLASSPATH to find JDBC Driver class (slide 5) Connection to database Connection (String urlDatabase, String userName, String password) throws SQLException

Không thể tạo bản xem trước, hãy bấm tải xuống
TÀI LIỆU MỚI ĐĂNG
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.