java.sql.SQLException: ORA-01009: missing mandatory parameter
don't understand why I am getting this error........
the method is
try{
url="jdbc:oracle:thin:@//172.21.1.2:1521/orcl";
user="XXXXX";
password="#####";
OracleDataSource ods =new OracleDataSource();
ods.setURL(url);
ods.setUser(user);
ods.setPassword(password);
connect = ods.getConnection();
}catch (Exception e){
System.out.print(e);
}
I have also tried this method for url
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=172.21.1.2)=(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORCL)(SERVER=DEDICATED)))
but then it gives me this error
java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=168821248)(ERR=12504)(ERROR_STACK=(ERROR=(CODE=12504)(EMFI=4))))
other application(about which I don't know how they are connectinng) are able to connect with service name "ORCL" then why not me.
please let me know if you found some solution....
[1289 byte] By [
hunterzza] at [2007-11-27 8:26:34]

# 4
Dear freind ,
thanks for trying to help me but both method is correct
actually for ORACLE
the old method was
url=jdbc:oracle:thin:@<host_ip>:<port>:<SID>
the new one is
url=jdbc:oracle:thin:@//<host_ip>:<port>/<SID>
i tried your method too....:)...thanks
hunterzz
# 5
Obviously it doesn't like the url=jdbc:oracle:thin:@//<host_ip>:<port>/<SID> because you are getting a
ORA-01009: missing mandatory parameter
Cause: A host language program call did not pass all required parameters. The syntax and parameter description for each call is shown in the Programmer's Guide to the Oracle Precompilers.
Action: Check the syntax for the call and enter all required parameters.
And the url=jdbc:oracle:thin:@<host_ip>:<port>:<SID> tries to connect but it doesn't like the SID
ORA-12504: TNS:listener was not given the SID in CONNECT_DATA
Cause: The SID was missing from the CONNECT_DATA.
Action: Check that the connect descriptor corresponding to the service name in TNSNAMES.ORA has an SID component in the CONNECT_DATA.
# 6
reffer
http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#05_04
according to them m URL is correct and sorry that is not SID it is SERVICE_NAME .......tnslintener.ora is correct because other application is connecting with it using this SERVICE_NAME(ORCL)....i tried that url too...but it gave me the same error ........i thing there is some concept of domain name after SERVICE_NAME like orcl.oracel.combut i m getting the same IO exception for that ....i don't know wht URL problem is there ......because my aplication administrator is saying that other applications are running fine with ORCL