Why do I receive the error "Io Exception: Connection refused" with Oracle 10g and the Database Toolbox 3.1.1 (R2006a) ?
1 次查看(过去 30 天)
显示 更早的评论
I am using the Query Builder from the Database Toolbox 3.1.1 (R2006a) to connect to my Oracle 10g database. Using the arguments as specified in the documentation, I get a dialog box with the following error:
Io Exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=169869568)(ERF=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4))))
If I use the DATABASE function with the following syntax:
conn = database('databasename','username','password','driver','databaseurl');
I get the following message in the database object, and the database is not opened:
Io Exception: The Network Adapter could not establish the connection
采纳的回答
MathWorks Support Team
2009-6-27
The issue is related to the incorrect usage of the DATABASE function. The DATABASE function expects the 'databasename' parameter to be the same as the SID parameter at the end of the 'databaseurl'. If the two are not the same, the 'databasename' is appended to the string in the 'databaseurl'.
In the Query Builder, the database 'Name' should be the same as the suffix after the port number in the database 'URL'
The correct syntax for the DATABASE function with Oracle 10g and the Thin Client JDBC drivers is
conn = database('databasename','username','password','oracle.jdbc.driver.OracleDriver',jdbc:oracle:thin:@IP_ADDRESS_OF_DATABASE_SERVER:1521:databasename');
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Connect to Database Programmatically 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!