Read about oracle jdbc connection string example, The latest news, videos, and discussion topics about oracle jdbc connection string example from alibabacloud.com
Ado. net
Connect to SQL ServerThe SQL Server. NET Framework Data Provider supports connection string formats similar to OLE DB (ADO) connection string formats.Using (sqlconnection connection = new sqlconnection (connectionstring )){Conne
Label:First install ha-instant Client-v11.2.0.3.0-x86.rar : Ftp://hhdown:[email Protected]/download/ha-instant%20client-v11.2.0.3.0-x86.rar Ftp://hhdown:[email Protected]/download/ha-instant%20client-v11.2.0.3.0-x64.rar Then perform the installation of ODBC a must choose to install Add environment variable: Tns_admin value:%oracleclient%/network/admin Modify Tnsnames.ora to add the server information that needs to be connected, Note the service_name in Connect_data must be added to ensure norm
Similar to other database systems, Oracle uses "|" to concatenate strings, which is the same as the plus sign "+" in MSSQLServer.For example, execute the following SQL statement:Copy codeThe Code is as follows:SELECT 'employee ID is '| FNumber |' employee name is '| FName FROM T_EmployeeWHERE FName IS NOT NULLIn addition to "|", Oracle also supports
Similar to other database systems, Oracle uses "|" to concatenate strings, which is the same as the plus sign "+" in MSSQLServer.
For example, execute the following SQL statement:
Copy codeThe Code is as follows: SELECT 'employee ID is '| FNumber |' employee name is '| FName FROM T_Employee
WHERE FName IS NOT NULL
In addition to "|", Oracle also supports
Method 1: Use System. Data. oracleclient (you need to install the Oracle client and configure tnsnames. ora ).
Oracleconnectionstring: Data Source = orcl; user id = Scott; Password = tiger; persist Security info = false;
Method 2: Use oldedb to connect
Oracleconnectionstring:
Provider = oraoledb. oracle.1; user id = Scott; Password = tiger; Data Source = (description = (address_list = (address = (Protocol
1. Select WINDOW> display View> other. The following window is displayed:
The content in this window is as follows (the following content is critical ):
Currently, ORACLE9I is installed in the default directory. Therefore, the JDBC driver of ORACLE9I is in C: \ oracle \ ora92 \ jdbc \ lib \ ojdbc14.jar, copy the file to the current jdk lib, So cop
'|' + 'Is used for string connection in Oracle '.
Select Rec. sheet_id,
Rec. orgid,
Org. orgname,
Case
When Rec. receive_flag = 2 then
(Case
When exists (select count (1)
Fromeosorg_t_organization
Where a. orgseq like '192. 99999. %'
And a. orgid = Rec. orgid) then
'[Group Company network operation department]'|Org. orgname--'[Group Com
Set the environment variable TNS_ADMINoracleproductapp5networkadminsamples to read the new tnsnames. ora location. You can use the client to connect to the oracle program.
Set the environment variable TNS_ADMIN =/oracle/product/app5/network/admin/samples to read the location of the new tnsnames. ora, and use the client to connect to the oracle program.
The n
Label:Go to: http://database.51cto.com/art/201011/232267.htm Similar to other database systems, Oracle string connections use the "| |" string concatenation, which is used in the same way as the plus sign "+" in MSSQLServer. For example, execute the following SQL statement:SELECT ' work number is ' | | fnumber| | ' The
process remember to introduce the JAR package Import java.sql.*; public class Fenye { public static void Main (String [] args) { try{ Class.forName ("Oracle.jdbc.driver.OracleDriver"); Connection ct=drivermanager.getconnection ("Jdbc:oracle:thin:@127.0.0.1:1521:orcl", "Scott", "Tiger"); ORCL-bit database name CallableStatement Cs=ct.preparecall ("{Call Fenye (?,?,?,?,?,?)}"); To give? Assign value Cs.setst
["Datacenter"].get ("user")+":"+databases["Datacenter"].get ("passwd")+"@"+databases["Datacenter"].get ("host")+"/"+databases["Datacenter"].get ("Sid")+ "? Charset=utf8")#查询数据strSQL = "Select C.indu_name from Upapp. Pub_indu_code c where C.indu_uni_code in (select B.indu_uni_code from Upapp. Pub_com_indu_rela b where b.indu_sys_code= ' "and B.com_uni_code in" (Select A.com_uni_code from Upapp. Stk_basic_info a where a.stk_code= ' 600000 ')) "Dfora = Pd.read_sql (strSQL, Oraconn) #返回一个DataFrame#写
Oracle Common link string format:Jdbc:oracle:thin:@//Jdbc:oracle:thin:@Jdbc:oracle:thin:@How to query SIDs under Linux:In the case of configuring an Oracle environment variable, you can use the Echo $ORACLE _sid if you are not able to query using PS-EF |grep Oracle:In the Windows environment,
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.