ralphskie Posted January 5, 2017 Share Posted January 5, 2017 Hello been exploring the JasperReports for a day now and its a great reporting tool.Ive succesfully installed the JRServer and JR Studio, been testing the MySQL database with JDBC Driver with good results both on JRServer & JR Studio.But now i want to test a datasource for SQLite, Downloaded a JDBC Driver here (https://github.com/xerial/sqlite-jdbc) and installed it on tomcat/lib.The problem is after testing the JRServer prompts a "Cannot get a connection, pool error" - please see attached imageDo you have any idea what this error is about?or suggestion for a good/working JDBC Driver for SQLite ps : I've tested this driver on JR Studio and it works well,did generate a report but once transfered to JRServer it wont and error still the same. Link to comment Share on other sites More sharing options...
hozawa Posted January 5, 2017 Share Posted January 5, 2017 The problem is not with JasperReports Server but with sqlite and tomcat. Have you checked the following thread at StackOverflow?http://stackoverflow.com/questions/4279632/how-to-configure-sqlite-in-tomcat-6/13261148 Link to comment Share on other sites More sharing options...
Solution ralphskie Posted January 6, 2017 Author Solution Share Posted January 6, 2017 Thanks for linking it @hozawa manage to solve it with their answers there.Anyways will share what i have done so maybe it can help someone here.1.Need to configure META-INF/context.xml (located on JRSERVER_install_path/apache-tomcat/webapps/jasperserver)<Resource name="jdbc/Sqlite" auth="Container" type="javax.sql.DataSource" driverClassName="org.sqlite.JDBC" url="jdbc:sqlite:/${catalina.home}/dbs/Application.db" factory="org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory"></Resource> name= any name you wanturl = the location of your database file - I copied my on the installation folder but no problems where you want to put itfactory = org.apache.tomcat.dbcp.dbcp2.BasicDataSourceFactory ----> for tomcat 8,if you have lower version kindly search for it 2. Edit WEB-INF/web.xml (located on JRSERVER_install_path/apache-tomcat/webapps/jasperserver)<resource-ref> <description>Reviews Database</description> <res-ref-name>jdbc/Sqlite</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth></resource-ref> 3. Make a new datasource in JRServer Use JNDI Datasource Service name = jdbc/Sqlite or whatever you put on step 1 NAME Test it,Thats all http://community.jaspersoft.com/sites/all/libraries/ckeditor/plugins/smiley/images/thumbs_up.gif Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now