JDBC thin, OCI: two Java methods provided by Oracle to access the Oracle database thin is to use Java to access the database, the advantage is that you do not need to install the client OCI, that is, to use Java to call the local Oracle client and then access the database. The advantage is that the database is fast but
Tags: style blog io ar color os sp for Java Packagecom.test;Importjava.sql.Connection;ImportJava.sql.DriverManager;Importjava.sql.PreparedStatement;ImportJava.sql.ResultSet;Importjava.sql.SQLException; Public classDbconn { Public StaticConnection Getconn (String db) {string drivername=""; String Dburl=""; String UserNa
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: or
driverSystem.out.println ("Start trying to connect to the database!") "); String URL= "Jdbc:oracle:" + "thin:@127.0.0.1:1521:xe";//127.0.0.1 is a native address, XE is the default database name for Lite OracleString user = "System";//user name, system default account nameString Password = "147";//The password you selected when you installed the settingscon = drivermanager.getconnection (url, user, password);//Get ConnectionsSYSTEM.OUT.PRINTLN ("
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
notestablish the Connection" Wh Ile connecting to Oracle Database 11g [ID947653.1]
Change the JDBC connection driver class Inyour application Server from:
Oracle.jdbc.driver.OracleDriverToOracle.jdbc.OracleDriver
2.4 Using TNS Name:dvd
String Dburl = "Jdbc:oracle:thin:
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
, 2002, Oracle Corporation. All rights reserved.sql> Conn user/[email protected] as sysdba//user and password are your needs bark username and password, such as sys/ 123456 error:ora-12500:tns: Listener cannot start private server processSql>exit;Cause: The local database corresponding service is not open, in the service to the Oracleu corresponding service opened(4) connect to the databasee:\>sqlplus/nologSql*plus:release 9.2.0.1.0-production on
configuration information in Oracle Net Manager management, and then link the string to the following notation:
Data SOURCE=TORCL; User Id=myusername; Password=mypassword;
Other ways of connecting, refer to the following, from other websites:
Oracle Connection string Summ
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 connection to the database. ?
There are two ways in which JDBC connects to an Oracle database:
Connection Database SID
Connecting to a database service_name
When the SID is connected, the string is as follows:URL="Jdbc:oracle:thin:@192." 168.56. :1521: orcl1 "Password=When Service_Name is connected, the
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 s
Event: The report interface database was suddenly unable to connect, resulting in an inability to count operations properly. Exception information: Io exception: Got minus one from a read call analysis: The database address and its configuration information are changed, after the query that the database adjusted to the cluster working mode. Results: 1. Modify the normal JDBC connection
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
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.