G***o 发帖数: 5158 | 1 my $.02
first, are you using OCI8 or THIN?
if OCI8,
make sure your URL string looks like this:
"jdbc:oracle:oci8:@"+< database >
the '@' in the URL string is required
is optional, make sure you
use SID.DOMAIN format if under Windows NT
if thin, sth like this:
jdbc:oracle:thin:@:1521: |
|
m***x 发帖数: 492 | 2 thin works, but oci8 doesn't work.
URL as: "jdbc:oracle:oci8:@tita:1521:tita" doesn't work
URL as: "jdbc:oracle:thin:@tita:1521:tita" works well.
What's wrong? |
|
m***x 发帖数: 492 | 3 【 以下文字转载自 Database 讨论区,原文如下 】
发信人: minix (格物至知), 信区: Database
标 题: JDBC of Oracle9iRelease2
发信站: The unknown SPACE (Sat Jan 4 01:26:38 2003) WWW-POST
thin works, but oci8 doesn't work.
URL as: "jdbc:oracle:oci8:@tita:1521:tita" doesn't work
URL as: "jdbc:oracle:thin:@tita:1521:tita" works well.
What's wrong? |
|
b****e 发帖数: 1275 | 4 【 以下文字转载自 Java 讨论区 】
【 原文由 breeze 所发表 】
i have a unicode string that i want to store to an oracle table.. i
tried varchar2 and long, but the result is not readable when I read
them out in a jdbc select nor in toad (with a chinese viwer)
if i print the string before it's inserted into oracle it's fine..
so that means something went wrong during the insert.. what could it
be? my oracle is already set to American/America/UTF8 (the NLS_LANG
setting) and it's oracle 8.1.7.. and i'm using the oci8 dri |
|
y********o 发帖数: 2565 | 5 So, you wanna open the connection in your code-behind?
For oracle, do this:
Instantiate an OracleDataSource object and pass your db user name and passow
rd as well as the network protocol to its setter methods, like so:
OracleDataSource ods = new OracleDataSource();
ods.setUser(dbUser); // e.g. "hr"
ods.setPassword(dbPassword); // e.g. "hr"
ods.setDriverType(driverType); // e.g. "oci8"
ods.setNetworkProtocol(networkProtocol); // e.g. "ipc"
And then you say,
Connection conn = ods.getConnection( |
|
t***t 发帖数: 6066 | 6 oci8 is for oracle 8i bah? |
|