Đang chuẩn bị liên kết để tải về tài liệu:
Java C8. JDBC

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

‘java.sql’ and ‘javax.sql’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the java.sql 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 ‘java.sql’ and ‘javax.sql’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the java.sql 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\ mysql-connector-java-5.1.7-bin.jar; 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 dbedit_1.0.3_1.bin.dist_3.X.zip 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 ‘java.sql’ and ‘javax.sql’ package SQL Interfaces for application JDBC Driver Manager manage two or more JDBC drivers ‘DriverManager’ class in the java.sql 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\ mysql-connector-java-5.1.7-bin.jar; 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 dbedit_1.0.3_1.bin.dist_3.X.zip 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 Class.forName() DriverManager.getConnection connection.createStatement() Statement.executeQuery/Update() Resultset.getParameter Connection.close() Loading of JDBC driver Public static class java.lang.Class.forName(String className) throws ClassNotFoundException JDBC driver is described by ClassName : mydriver.ClassName Create an instance of this class to load JDBC driver Loading of JDBC driver : Exemple Exemple : Loading JDBC driver of MySQL database try { Class.forName ("com.mysql.jdbc.Driver"); } catch (ClassNotFoundException e){ System.err.println (“Do not connect"); } Note : set CLASSPATH to find JDBC Driver class (slide 5) Connection to database Connection java.sql.DriverManager.getConnection(String urlDatabase, String userName, String password) throws SQLException

TÀI LIỆU LIÊN QUAN
Đã 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.