Friday, 1 February 2013

Connecting Jasper Report Server 4.5 to MySQL Database


JasperReport Server 4.5 and later version comes with default PostgreSQL database (Open Source Database), and you may need to use MySQL database, so in order to connect MySQL with JasperReport Server, you need to copy a MySQL connector.
These are the simple steps to do this:-

Step 1:-
             Open this link  and download mysql-connector-java-5.1.22. tar.gz  file.
Step 2:-
             Untar tar.gz the file, copy mysql-connector-java-5.1.22-bin executable jar file, and paste under these directories-
                                      /jasperreports-server-cp-4.5.0/apache-ant/lib

                                      /jasperreports-server-cp-4.5.0/apache-tomcat/lib

                                      /jasperreports-server-cp-4.5.0/apache-tomcat/webapps/jasperserver/WEB-INF\lib

                                       /jasperreports-server-cp-4.5.0/buildomatic/conf_source/db/mysql/jdbc

Step 3:- Go to this directory
                                      /jasperreports-server-cp-4.5.0/buildomatic  
             and edit default_master.properties file and change these properties according to your MySQL database like –
                                      # database type                                                                                    
                                         dbType=mysql
                                      # database location and connection settings
                                         dbHost=localhost
                                         dbUsername=root
                                         dbPassword=root
                                      # additional database parameters
                                      # (uncomment these if you want non-default settings)
                                         dbPort=3307
Step 4:- Restart the JasperReport server properties using this command
                                      /jasperreports-server-cp-4.5.0/ctlscript restart

        (You can restart the services in Windows operating system from Start Menu option)



No comments: