lesley 发表于 2006-2-28 14:44

急问,在连数据库时出错了,帮我看看错在哪里?谢谢!

connection= database ('studentdatabase','','')
cursor = exec(connection, 'select * from learningstyle')
??? No constructor com.mathworks.toolbox.database.sqlExec with matching signature found.
我在运行后面一条语句时,就出现这种提示的错误了,请问我是哪里没有搞清楚呢?谢谢!

VibInfo 发表于 2006-2-28 15:03

在网上搜了一下,发现和你一样的问题,下面是回复

Subject:Why am I having problems connecting to a remote Oracle 9.2 database using the Database Toolbox?
Problem Description:I am having trouble connecting to Oracle database software version 9.2.0.1.0 using the Database Toolbox 3.0.1. The database is on a remote server (Sun Solaris). I get the following error when I attempt to run the EXEC command:

no constructor with com.mathworks.toolbox.database.sqlExec with matching signature found.

When I read the Message field of the database connection object as follows:

conn = database(...)
conn.Message

I get the following message:

Invalid Oracle URL specified

However, I am able to connect to the Oracle database, using this URL, from Java code outside of MATLAB. I am using an OCI driver to connect to the database and even upgraded to MATLAB 7.0.4 (R14SP2) to try to resolve the issue.
Solution:We recommend that you use the JDBC thin drivers as they are easier to configure than OCI drivers. For JDBC thin drivers, the MATLAB/toolbox/local/classpath.txt entry appears similar t

/home/username/classes111.zip

To make a connection using a JDBC thin driver specify the driver and URL as follows:

Driver: oracle.jdbc.driver.OracleDriver
URL: jdbc:oracle:thin:@192.171.xxx.xx:xxxx:

The Oracle OCI JDBC drivers are type 2 drivers, meaning that there is additional software beyond the base Oracle installation that must be installed. The OCI client software consists of additional libraries that the JDBC OCI drivers need in order to make the connection to Oracle. The location of these installed libraries must be included in the file $MATLAB/toolbox/local/librarypath.txt.

For example, for a UNIX system, if Oracle is installed in /oracle/ora92, the entry in librarypath.txt would appear as

/oracle/ora92/lib32

The files in that directory are:

For Windows:

ocijdbc9.dll
ocijdbc9_g.dll
heterox.dll
heterox_g.dll

(_g indicates debug version)

For UNIX:

Files have .lib extension, ie ocijdbc9.lib

If MATLAB cannot locate the libraries, the following error message appears:

??? Java exception occurred:
java.lang.UnsatisfiedLinkError: no ocijdbc9 in java.library.path

To make a connection using a JDBC OCI driver, specify the driver and URL as follows:

Driver: oracle.jdbc.driver.OracleDriver
URL (example): jdbc:oracle:oci8:@fogo

lesley 发表于 2006-2-28 15:36

非常谢谢!

sockhui 发表于 2010-1-25 22:54

你没有配置好你的数据源

ChaChing 发表于 2010-1-26 22:37

回复 地板 sockhui 的帖子

数据库的函数个人没用过, 楼上的好像满熟这方面!
有空多分享些使用心得!
版面上好像还有许多这方面的问题待回!

[ 本帖最后由 ChaChing 于 2010-1-26 23:17 编辑 ]
页: [1]
查看完整版本: 急问,在连数据库时出错了,帮我看看错在哪里?谢谢!