This article is reproduced from http://www.cnblogs.com/leiOOlei/archive/2013/10/21/3380568.htmlBecause it is a second encounter, so copy come over, afraid of other people's blog after the latter what reason, can't find.View your Oracle version first, log into the database using Sqlplus/as SYSDBA, and have explicit version information in the ECHO message1. Download the appropriate version from the official Oracle
Tags: database configuration in spring JDBC driver packageConfiguration of data sources in spring and JDBC driver packages for various databases (Oracle, MySQL, SQL Server, etc.)When developing a database-based application system, you need to configure the data source in your project to obtain a database connection for the operation of the database. The methods f
Tags: uil www art one file drive pre connection Count dependentOne, when we need to connect to a database in a MAVEN project, we only need to configure its dependencies, but Maven does not provide Oracle JDBC driver, which is not available due to Oracle licensing issues and needs to be added manually. Second, get the jar package that connects to the database, her
When using this method, you need to add the Oracle jar package to the classpath variable. This package can be found in $ ORACLE_HOME/jdbc/lib/classes12.jar of the oralce client program.
Import java. SQL .*;
Public class jdbcthin {// Dburl database connection string information, where "1521" is the port and "ora9" is the SIDString dburl = "JDBC:
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 refused the connection with the following error
Tags: size basename search get state data connection 1.5 password differentThe JDBC connection data is a key point of javaweb development, and today we summarize and deepen our memory. The JDBC Connection database is divided into three steps: 1: Load Driver Need to download the respective drive jar package, you can go to the Internet search. Template: load driver: Class.forName (Driverclass); Different data
Tags: cal creat png div src rest key cti User1, follow Oracle 2, CREATE DATABASE footsteps DROP TABLE person;
DROP SEQUENCE myseq ; //Set the self-increment sequence.
CREATE SEQUENCE myseq;
CREATE TABLE person
(
ID int. PRIMARY KEY not NULL,
name VARCHAR (#) not NULL,
age INT,
birthday DATE
); 3, then configure the driver. 4, execute: Get program: Dbdriver = "Oracle.jdbc.driver.OracleDriver",
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:Using JDBC to connect to the database, fly is divided into three steps: The first step: Download a JDBC driver, then throw the jar package into the project and add to build path; Step two: Go to the local Oracle folder to find "TNSNames." ORA "file, open the connection string to locate the corresponding database, as the connection string for
{
the e.printstacktrace (); - }
Wu finally
- {
About Try
$ {
- //close each of the above objects individually, because if you do not close it, it will affect performance and consume resources - //Note the order of the closing, the last used first close
- if(Res! =NULL)
A res.close (); + if(Pre! =NULL)
the pre.close (); - if(Connection! =NULL)
$ connection.close (); theSYSTEM.OUT.P
JDBC calls the Oracle Stored ProcedureExamples of returning result sets and obtaining output parameters are the main content we will introduce in this article. Next we will introduce this process. Let's take a look at it.
Package xx. qq. app;
Import java. SQL. CallableStatement;
Import java. SQL. Connection;
Import java. SQL. ResultSet;
Import org. springframework. beans. factory. BeanFactory;
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
JDBC reading of Oracle US7ASCII encoding Chinese garbled characters and the use of Chinese Characters in different encodings
Database Version: Oracle 10g
Character Set: SIMPLIFIED CHINESE_CHINA.US7ASCII
JDK: 1.6.0 _ 45
Oracle DRIVER: ojdbc14.jar
It is no problem to use JDBC
Label:I'm using a lite version of Oracle. 1 Importing an Oracle driver package Oracle Down Path D:\oracle\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar 2 views Listenerduankouhao D:\o
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.