Jump to content
Changes to the Jaspersoft community edition download ×

Simple JDBC Connection for local MySQL DB on Windows Machine?


Recommended Posts

I am using Jaspersoft Studio 6.40 and I am trying to determine the easiest way to connect to a local MySQL DB on a windows machine in order to create reports.  The JRXML file will be uploaded Jasperserver running AWS Linux.  The MySQL DB is stored in a folder on a Windows 10 machine, that is also running Jasper Studio.

I went to create an adapter, chose the JDBC connection, which I am assuming is the proper Data Adapter.

What is the best driver to use for JDBC? What should be the JDBC Url? For example, if the MySQL DB is located in c:mydatabase, what would the url be? Do I need to run VMWare or something similar to create a localhost




Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

localhost is a standard syntax that indicates the current machine.  You do not do anything to create it. You need to have the database up and running, but nothing else.

I suspect you're expecting something fancier when you create the data adapter.  When you set up the data adapter as below, click Test and you will get a response saying if the adapter is valid. You don't have any insight into the database content when you create the adapter.

Once you have an adapter, you can use it in a report.  Read the documentation section on "creating a simple report" to see how to create a report and choose an adapter.  Once you use your adapter in a report, you can create an SQL query to select the data for the report. You will see a simple interface that shows you the available fields, but if you need an advanced tool to create a complex query, it might be best to create the query outside JSS and copy it into the Dataset and Query dialog for the report. 

If you want to upload your report to JasperReports Server, you need to either create a new data source on your JRS that connects to the database or you need to make sure that your data adapter in JSS is local, not global, and then it will publish as a resource when you publish the report.  

Link to comment
Share on other sites

Sorry, but I am trying to determine the easiest way to get the DB "up and running".  I have a .sql file on a Windows machine.  If I can connect to it on MySQL workbench, what url do I use? for example, something like 
JDBC Url: jdbc:mysql://localhost/mydatabasename, or is it something like jdbc:file://localhost/mydatabasename

Or is it creating a new DB inside of Jasper Studio, and then importing the sql file?

I just want the easiest way since the local machine is not using the DB for anything other than Jasper Studio, and does not need to have a virtual machine for any other purpose.


Link to comment
Share on other sites

  • 2 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...