Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

invalid SQL url specified

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Dear Pro.:
i tried to test my driver version, and the error message is:

Exception in thread "main" java.sql.SQLException: Invalid Oracle URL specified
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:182)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at Test.main(Test.java:6)

i used thin driver, my database is wendb, user is wen, pwd is wen
below is my tnsnames.ora data:

# TNSNAMES.ORA Network Configuration File: D:\oracle\ora81\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

WENDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = wenkai)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = WENDB)
)
)

INST1_HTTP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = wenkai)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = SHARED)
(SERVICE_NAME = WENDB)
(PRESENTATION = )
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

what would be the correct URL:
Connection conn=DriverManager.getConnection ("jdbc:eek:racle:thin:mad:?:?:?","wen","wen");

thank you...
 
jdbc:eek:racle:thin:mad:<hostname>:<port>:<dbname>,&quot;uname&quot;,&quot;passwd&quot;
Is the correct form of URL.
I use the one above to connect to my database, all the blanks are filled in of course
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top