Method for accessing databases in Java

xiaoxiao2021-03-06  131

1.ODBC connection, first configure Oracle data source in the ODBC of the control panel, very simple. Then load drive in the Java program: Class.Forname ("Sun.jdbc.odbc.jdbCodbcDriver"). NewInstance (); data Connection to: Connection Conn = DriverManager.getConnection ("JDBC: ODBC: Database", User, Password); 2. Direct Database: If you are Oracle, first download a driver (www.oracle.com), package to class 111 In the window toolbar, PROJECT-Project Properties L Add to IMPORT ORACLE.JDBC.DRIVER.OracleDriver; ... Class.Forname ("Oracle.jdbc.driver.Oracledriver", User, Password; connection conn = DriverManager.getConnection ("JDBC: Oracle: Thin: @ 192.168.1.3: 1521: Orcl", user, password); 3.Weblogic Pool; 4. There are two kinds of jildi to configure WebLogic, launch console, in it Configuration; there are still many, which provides corresponding CA drivers for different database product manufacturers, and 2.

a. ODBC-JDBC Driver JDK has brought B. JDBC Native Driver (requires DB Client software, DB Client through JNI), such as: IBM DB2 Driver, Oracle OCI Driver C. JDBC Pure Driver (Convert JDBC into database already existing API) D. JDBC Direct-To-Database Pure Driver (Database itself has supported JDBC API) such as: Oracle JDBC Driver, merant SQLSERVER Driver, DB2 Driver, etc. JDBC 2.0 protocol supports DataSource concept, you can create a connection pool to improve performance . So if your JDBC Driver supports 2.0, you can use DataSource. Some Driver is not full support 2.0, but will also support the concept of DataSource. This is the most basic concept, which has an EJB (Entity Bean), JDO (Java Data Object). Compared to ODBC / ADO (JDBC / JDO / EJB). The idea of ​​upstairs is confused, and there is no basic concept. 2. And the Corba I I installed, EJB can't be used, what Dandid is needed? Can use it! - To use the Enterprise version of License

转载请注明原文地址:https://www.9cbs.com/read-126104.html

New Post(0)