Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Escaping password in oracle connection string (pass containing semicolons, quotes etc)

Escaping password in oracle connection string (pass containing semicolons, quotes etc)

From: Am <amiran.chyb_at_gmail.com>
Date: Mon, 12 Nov 2007 20:59:34 -0000
Message-ID: <1194901174.489820.241970@57g2000hsv.googlegroups.com>


Hi there

I've just found the problem in application I'm working on (c#, .net 2.0) - since at some point it merges the connection string from unquoted attributes values (user=username;password=pass etc.) the native oracle access object throws exception when the password contains semicolon.
Msdn describing default microsoft oracle access class (http:// msdn2.microsoft.com/en-us/library/
system.data.oracleclient.oracleconnection.connectionstring(VS. 80).aspx) says that one can always quote the whole value with doublequotes  and escape each additional double quote in password by adding another one in front of it.

Unfortunately native oracle library throws "wrong conection string format" when quoted password contains doubled double-quotes inside.

Hence there's no way to escape all possible passwords unless: a) there's other way to connect than through fully merged connection string (e.g. by passing attributes individually) b) valid password characters set is limited

regarding b) there's lot of contradictory opinions on the net - some say everything goes (full ASCII), some say the opposite. Does is depend on the RDBMS version?

solution a) would be the most elegant, but I don't know such a way - do you?

thanks a lot
Am. Received on Mon Nov 12 2007 - 14:59:34 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US