Topic: JBUILDER 怎样通过JDBC 连接SQL???

  Print this page

1.JBUILDER 怎样通过JDBC 连接SQL??? Copy to clipboard
Posted by: fly21
Posted on: 2002-12-08 12:53

JBUILDER 怎样通过JDBC 连接SQL2K 数据库(不是桥的那种)。

2.从微软网站下载SQL Server JDBC Driver先 [Re: fly21] Copy to clipboard
Posted by: rainman
Posted on: 2002-12-08 13:25

是Type 4的,不算桥了。

3.能否详细说明 [Re: fly21] Copy to clipboard
Posted by: fly21
Posted on: 2002-12-08 19:06

在环境变量中已经配置如下:classpath=d:\jdbcDriver\msbase.jar;d:\jdbDriver\mssqlserver.jar;d:\jdbcDriver\msutil.jar,JDK配置略。,但加载驱动时就失败,编译时有下列错误提示:"com.microsoft.jdbc.sqlserver.SQLServerDriver" does'nt exist

4.Re:能否详细说明 [Re: fly21] Copy to clipboard
Posted by: mleeee
Posted on: 2002-12-08 19:16

fly21 wrote:
在环境变量中已经配置如下:classpath=d:\jdbcDriver\msbase.jar;d:\jdbDriver\mssqlserver.jar;d:\jdbcDriver\msutil.jar,JDK配置略。,但加载驱动时就失败,编译时有下列错误提示:"com.microsoft.jdbc.sqlserver.SQLServerDriver" does'nt exist


is there a typos in the second classpath: d:\jdbDriver\mssqlserver.jar?
if you just coped and pasted the classpath, i think there is the problem, it should be d:\jdbcDriver\mssqlserver.jar.

I never use the ms sql jdbc driver. could u check if there is a "com.microsoft.jdbc.sqlserver.SQLServerDriver" in these three jar files by decompressing them using winrar? if no, u still haven't installed the jdbc driver properly.

5.think u [Re: fly21] Copy to clipboard
Posted by: fly21
Posted on: 2002-12-08 20:26

let me try.i am a beginer,think u a lot.

6.The best way is [Re: fly21] Copy to clipboard
Posted by: fredfred
Posted on: 2002-12-13 01:21

to copy the jdbc drivers, such as M$, Oracle, any others to the %jb_installation%\lib, then JB will add those driver to its classpath automatically.

7.thank u!! [Re: fly21] Copy to clipboard
Posted by: fly21
Posted on: 2002-12-13 13:24

thank u very much,fredfred.i have succeed in connecting to sqlserver.
but if i don't copy those three files to %jb_installation%\lib,i config in classpath as follows:
C:\jdbcDriver\lib\msbase.jar;c:\jdbcDriver\lib\mssqlserver.jar;C:\jdbcDriver\msutil.jar; i fail,why?

8.because you are working in JB environment, [Re: fly21] Copy to clipboard
Posted by: fredfred
Posted on: 2002-12-14 15:08

the application is running in Jb environment too. So the JB just search the its own classthpath rather than OS's classpath. what you did was put the drivers into OS's classpath, so the JB could not find the drivers.

There is another way that let the JB know where is the driver or any other libraries, follow the steps to add the drivers into JB's classpath:
tools->configure libraries->new folder(give any name for the driver)->add (add any classes or jar that you want ).

Actually you can find the information in the JB's doc.

9.Re:JBUILDER 怎样通过JDBC 连接SQL??? [Re: fly21] Copy to clipboard
Posted by: lakeheart
Posted on: 2003-01-03 16:22

很简单,你先将microsoft 的jdbc 驱动程序下载,然后解压缩到一个目录下,在library下的有msutil.jar, mssqlserver.jar,msbase.jar,启动jbuilder,在user library 新建一个sql2000lib,将以上三个文件加入。然后你就可以使用了。
1。在database pilot 中使用,在tools->enterprise setup->database drivers->add. 选中sql2000lib,你就可以在database pilot 中用了
2。在project properties将sql2000lib 加入到lib就可以用了

10.谢谢lakeheart [Re: fly21] Copy to clipboard
Posted by: fly21
Posted on: 2003-01-03 20:47

好高兴,我连上数据库了。谢谢lakeheart 的帮助。


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923