声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 3613|回复: 4

[编程技巧] 急问,在连数据库时出错了,帮我看看错在哪里?谢谢!

[复制链接]
发表于 2006-2-28 14:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

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

使用道具 举报

发表于 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

评分

1

查看全部评分

 楼主| 发表于 2006-2-28 15:36 | 显示全部楼层
非常谢谢!
发表于 2010-1-25 22:54 | 显示全部楼层
你没有配置好你的数据源

评分

1

查看全部评分

发表于 2010-1-26 22:37 | 显示全部楼层

回复 地板 sockhui 的帖子

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

[ 本帖最后由 ChaChing 于 2010-1-26 23:17 编辑 ]
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-12-29 09:24 , Processed in 0.099679 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表