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
Oracle.jdbc.driver.OracleDriver.getConnectionInstance (oracledriver.java:442) At Oracle.jdbc.driver.OracleDriver.connect (oracledriver.java:321) At Org.apache.commons.dbcp.DriverConnectionFactory.createConnection (driverconnectionfactory.java:38) At Org.apache.commons.dbcp.PoolableConnectionFactory.makeObject (poolableconnectionfactory.java:294) At Org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory (basicdatasource.java:1247) At Org.apache.commons.dbcp.BasicDataSource.createDataS
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{Public
The RAC configuration is as follows:
Node1: IP address 192.168.60.132, Instance name: Rac1, Host Name: Rac1
Node2: IP address 192.168.60.144, Instance name: rac2, Host Name: rac2
The RAC service name is oratest.
My application server is Apache + Tomcat
The configuration process is as follows:
1. After searching, we found that there are many connection RAC methods and copied the following jdbcurl:
JDBC
Import java. SQL .*;
Public class ora8iconnect{Public ora8iconnect (string dB, string ID, string PWD){Dbname = dB;Userid = ID;Userpwd = PWD;Beginconnect (); // connect to the database}/*-* Returns a connection object.*/Public connection getconnection () {return conn ;}
/*-* Connect to the database. If the connection succeeds, 1 is returned. Otherwise, 0 is
username password, and does not require a database URL.
A. JDBC Connection Oracle Description
JDBC Application Connection Oracle encountered a problem with the following error:
Ora-
Xuzhou needs to connect to a third-party database. The original database uses a Windows Cluster and is recently changed to the RAC mode, leading to frequent JDBC connection errors. Solution:
1. connection string Configuration:
JDBC: oracle: thin: @ (description = (address_
Tags: Oracle jdbc javaToday, when the project starts to access a database, it appearsORA-12505, Tns:listener does not currently know of SID given in Connect Desc.Look back, my database is configured as:Driverclassname=oracle.jdbc.driver.oracledriverurl=jdbc:oracle:thin:@158.58.88.102:1521:ESKDBUsername=rootpassword=aaa111And then we looked at Oracle's Tnsnames.ora configuration.eskdb= (DESCRIPTION = (Addres
the connection: ? can call DriverManager Class of getconnection () method to establish a connection to the database ? JDBC URL used to identify a driver that is registered with the driver manager through this URL Select the correct driver to establish a
Tags: pass ETH generated classname nbsp Int method Display PropertyYou need to import the relevant jar package before accessing the database using a connection pool. First, you need to import the Oracle driver package, usually in the directory where the Oracle database is installed, there is a Ojdbc6.jar driver package in the reader's directory. You then need to
Tags: CREATE DATABASE exec load Ace out database com strong except To connect to a database step:1. Registration driver (only once)2. Establishing a connection (Connection)3. Create a statement that executes SQL (Statement)4. Execute the statement5. Processing execution Results (RESULTSET)6. Releasing ResourcesExample:Public voidConnectionoracle ()throwssqlexception{Con
Java JDBC Connection Oracle Three ways
Oracle JDBC Connection ServiceName
jdbc:oracle:thin:@//:/
Example: Jdbc:oracle:thin@//10.1.112.110:1521/health
Note: There is//behind the @. This format is primarily for clusters, with di
A classmate sent a message that the Oracle database uses a JDBC connection to report ora-12505 errors.Subconsciously replied to see if the database Sid/service name in the JDBC connection string was incorrectly written.The other side feedback said yes. Then let him connect i
The example in this article describes Java's approach to Oracle 11g RELEASE2 based on JDBC. Share to everyone for your reference. Specifically as follows:
The JDBC connection for Oracle 11g Release 2 appears to be different if you receive the following exception:
Listener
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.