水晶报表CrystalReport2008使用JDBC连接MySQL数据库-详细步骤

学习 专栏收录该内容
12 篇文章 0 订阅


详细请见BLOGhttp://snowdream.blog.51cto.com/3027865/1081366

 

: 前期准备工作

  • Crystal Report 2008

  • JDBC 相关jar --- mysql-connector-java-5.1.22-bin.jarMySQL

     

    Jar包下载:

    mysql-connector-java-5.1.22-bin.jar  见附件)

     

           JAR包添加:

    1. JAR包放在水晶报表CrystalReport的目录下面

    C:\ProgramFiles\Business Objects\Common\4\java\lib\external

    2. 然后找到 JAR包的配置文件CRConfig.xml

    C:\ProgramFiles\Business Objects\Common\4\java\CRConfig.xml

           3. 打开CRConfig.xml <Classpath>添加

<Classpath>C:\Program Files\BusinessObjects\Common\4.0\java/lib/external/mysql-connector-java-5.1.22-bin.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/crlovmanifest.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/CRLOVExternal.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/CRDBJDBCServer.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/CRDBXMLServer.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/CRDBJavaBeansServer.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/external/CRDBXMLExternal.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/external/log4j.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/CRDBSForceServer.jar;

C:\Program Files\BusinessObjects\Common\4.0\java/lib/external/CRDBSForceExternal.jar;${CLASSPATH}</Classpath>

4. 更改水晶报表的JDK环境

                           <!--<JavaDir>C:\Program Files\BusinessObjects\javasdk\bin</JavaDir>-->

                        <JavaDir>C:\ProgramFiles\Java\jdk1.6.0_06\bin</JavaDir>

JAR包添加完毕!

准备工作完成!

:  打开Crystal Report 2008

打开file> new> stander report

Connection URL : jdbc:mysql://LOCAL_HOST:3306/DB_NAME 

                  例如: --- jdbc:mysql://localhost:3306/db_name)

Database ClassName:    com.mysql.jdbc.Driver

        

       至此成功连接数据库.

 

       END

 

2012-12-07

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 扫一扫,分享海报

平日学习总结. 纯手工编辑啊!! 谢谢支持! -------------- 一: 前期准备工作  Crystal Report 2008JDBC 相关jar包 --- mysql-connector-java-5.1.22-bin.jar(MySQL) Jar包下载: mysql-connector-java-5.1.22-bin.jar (见附件) JAR包添加: 1. 把JAR包放在水晶报表CrystalReport的目录下面 C:\Program Files\Business Objects\Common\4\java\lib\external 2. 然后找到 JAR包的配置文件CRConfig.xml C:\Program Files\Business Objects\Common\4\java\CRConfig.xml 3. 打开CRConfig.xml 在<Classpath>添加 <Classpath>C:\Program Files\Business Objects\Common\4.0\java/lib/external/mysql-connector-java-5.1.22-bin.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/crlovmanifest.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/CRLOVExternal.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/CRDBJDBCServer.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/CRDBXMLServer.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/CRDBJavaBeansServer.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/external/CRDBXMLExternal.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/external/log4j.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/CRDBSForceServer.jar; C:\Program Files\Business Objects\Common\4.0\java/lib/external/CRDBSForceExternal.jar;${CLASSPATH}</Classpath> 4. 更改水晶报表JDK环境 <!--<JavaDir>C:\Program Files\Business Objects\javasdk\bin</JavaDir>--> <JavaDir>C:\Program Files\Java\jdk1.6.0_06\bin</JavaDir>
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值