Label:Maven adds dependency issues for Oracle JDBC driversOracle's JDBC Driver jar package cannot be downloaded in the MAVEN project and requires Oracle's official authorization to To find a ojdbc14 10.2.0.1.0 or 10.2.0.2.0 package, let maven re-hit the jar package and place it in the local repository by following the
Tags: confluenceFor license-based considerations, we cannot bundle Oracle drivers into confluence. If you want your confluence to be able to connect to an Oracle database, you need:
Stop confluence.
Go to the Database JDBC Drivers page and download the correct driver. The
Because of Oracle commercial copyright issues, MAVEN cannot download jar packages directly through the central repository, and if you want to use jar packs, you need to manually process them.
Step One: Place the Ojdbc14.jar in the user's directory, such as: C:\Users\qicyt1812
Step Two: Execute the command in cmd: mvn install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar
C:\USERS
1. Create a jdbc.properties file driver=oracle.jdbc.driver.oracledriverurl=jdbc:oracle:thin:@127.0.0.1:1521:orclusername=systempassword=1234562. Create a connection tool PackageCom.util;Importjava.sql.Connection;ImportJava.sql.DriverManager;Importjava.sql.SQLException;Importjava.util.Enumeration;ImportJava.util.ResourceBundle; Public classORACLEJDBC {Private StaticString driver; Private StaticString URL; P
driver package introduced in the demo, which includes the oracleconnectionpooldatasource class that implements the database connection pool., You need to go to the Oracle website to download according to your own database version (click to open the link ). The Code is as follows:
Pooldbsource class
Package COM. ***. connectionpool. DB; import Java. SQL. connection; import Java. SQL. sqlexception; import ja
.
"The FROM keyword was not found at the desired location"
923
42000
SELECT ename EMP
"Missing expression"
936
42000
SELECT from EMP
"Table or view does not exist"
942
42000
SELECT ename from Empp
"Cannot insert null value"
1400
23000
An attempt was made to insert a null value into a column that contains a not NULL constraint
"Value is greater than specified precision for this column"
packagecom.ist.common.util;importjava.sql.*;importjavax.naming.context;import Javax.naming.initialcontext;importjavax.naming.namingexception;publicclassjdbcoracletest NBSP;{NBSP;NBSP;NBSP;NBSP;//ORCL is the database name in the Oracle database, and localhost represents the Oracle database that connects to the native //1521 is the port number of the connection privatestatic stringurl= "JDBC:ORACLE:THIN:@192
Label:Java Connection to Oracle database JDBC (Java Data Base Connectivity,java database connection), then how do we use Java to connect the database? importjava.sql.connection;
importjava.sql.drivermanager;
importjava.sql.preparedstatement;
importjava.sql.resultset;
importjava.sql.sqlexception; publicclassjdbc{Publicstaticvoidmain (String[]args) {//1. Importing jar Packages Project name---->buidpath-----
In the SPRINGMVC framework, Oracle Data sources are configured in Spring-servlet.xml as follows:
destroy-method= "Close" >
The exception is as follows:
caused by:org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection; Nested exception is org.apache.commons.dbcp.SQLNestedException:Cannot create JDBC
1, to the database, the table of each row of data record additions and deletions to changeAdd: INSERT into Table name values ()Delete: Delete table name where condition (id=? )Change: Update table name set column name =? Where Condition (id=? )Check: Select column name from table name where id=? Look up a piece of informationSelect Column name from table name order by ID check all information2. ResultSet result setis an interface that points to a pointer to the current data row, starting at the
Because of Oracle's commercial copyright issues, maven cannot download the jar package directly from the central repository, and if you want to use a jar package, you need to handle it manually. The first step: Put Ojdbc14.jar in the user directory, for example: C:\Users\qicyt1812 Step Two: Execute the command in cmd: mvn install:install-file-dgroupid=com.oracle-dartifactid=ojdbc14-dversion=10.2.0.1.0- Dpackaging=jar-dfile=ojdbc14.jar
C:\Users\ qicyt1812 >MVN INSTALL:INSTALL-FIL
Label:Start by first preparing to test if the Oracle database starts normally "is the primary Oracle-related service open"Then create a class that connects to the database with the first thing to remember is what steps are required to connect to the database, and what parameters are required for these steps 1. Load class-driven parameters:the corresponding driver
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.