Monday, 5 August 2013

NextReports: add your JDBC driver

Starting from version 6.2 NextReports will allow users to add their own JDBC drivers. We are using Vertica JDBC driver here as example. In version 6.2 Vertica driver will be added by default.

Such process can be resumed by following steps :

1. JDBC jar driver is added inside lib folder (designer and server). From 7.0, designer has a jdbc-drivers folder.

2. Driver must be added in driver_templates.xml which can be found :
  • inside designer in installation folder in \lib\nextreports-designer-6.1.jar 
  • inside server in installation folder in \webapps\nextserver\WEB-INF\classes 


3. You need to create a Dialect class for that type of driver. This dialect does a mapping between database types and java sql types and has some utilities methods.
import java.sql.Types;
import ro.nextreports.engine.util.ProcUtil;

public class VerticaDialect extends AbstractDialect {

public VerticaDialect() {
registerColumnType("binary", Types.BLOB);
registerColumnType("varbinary", Types.BLOB);
registerColumnType("bytea", Types.BLOB);
registerColumnType("raw", Types.BLOB);
registerColumnType("boolean", Types.BOOLEAN);
registerColumnType("char", Types.CHAR);
registerColumnType("varchar", Types.VARCHAR);
registerColumnType("date", Types.DATE);
registerColumnType("timestamp", Types.TIMESTAMP);
registerColumnType("timestamp with timezone", Types.TIMESTAMP);
registerColumnType("datetime", Types.TIMESTAMP);
registerColumnType("smalldatetime", Types.TIMESTAMP);
registerColumnType("double precision", Types.DOUBLE);
registerColumnType("float", Types.FLOAT);
registerColumnType("float8", Types.FLOAT);
registerColumnType("real", Types.DOUBLE);
registerColumnType("bigint", Types.BIGINT);
registerColumnType("smallint", Types.SMALLINT);
registerColumnType("integer", Types.INTEGER);
registerColumnType("int", Types.INTEGER);
registerColumnType("tinyint", Types.INTEGER);
registerColumnType("int8", Types.INTEGER);
registerColumnType("decimal", Types.INTEGER);
registerColumnType("numeric", Types.NUMERIC);
registerColumnType("number", Types.NUMERIC);
registerColumnType("money", Types.NUMERIC);
registerColumnType("time", Types.TIME);
registerColumnType("time with timezone", Types.TIME);
registerColumnType("interval", Types.TIME);

public String getCurrentDate() throws DialectException {
return "current_date";

public String getCurrentTimestamp() throws DialectException {
return "current_timestamp";

public String getCurrentTime() throws DialectException {
return "current_time";

public String getCurrentDateSelect() {
return "select current_date";

public String getRecycleBinTablePrefix() {
return null;

public String getCursorSqlTypeName() {
return ProcUtil.REF_CURSOR;

public int getCursorSqlType() {
return Types.OTHER;

public String getSqlChecker() {
return "select 1";
    4. You must register the dialect in NextReports. To make this happen in designer and server you have to add some java VM parameters. (nextreports.vmoptions  file from designer and start-nextserver.vmoptions from server)
    -Dnext.dialect.database_1="Vertica Database" 

    First parameter must be the name taken from DataBaseMetaData.getDatabaseProductName().

    If you need to register more dialects, you use different suffix indexes.


    1. Hi all,
      I'm trying to add the as400 jdbc driver to next-reports (designer). However, I'm up to the point that I can add the connection details and that next-reports finds the jt400.jar file (put it in the jdbc-drivers directory). When trying to connect I get the error 'Could not get Dialect'. Which makes sense as I cannot find how to add the file to next-reports. The last sentence in the blog is 'First parameter must be the name taken from DatabaseMetaData.getDatabaseProductName()' which I do not understand just as the process of adding the file. Can anyone help me out here?
      To further clarify, when saving the connection I am able to browse the schemas on the as400/iSeries but cannot see the tables below.

    2. Furthermore, after unpacking the nextreports-designer.jar file, I've added the driver to driver_template(s).xml but when trying to add a new datasource, it does not see the new datasource. Do I need to make the jar again with the modified driver_template(s).xml?

    3. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java EE Online Training from India . Nowadays Java has tons of job opportunities on various vertical industry.

      Java Online Training

    4. I think this is the best article today. Thanks for taking your own time to discuss this topic, I feel happy about that curiosity has increased to learn more about this topic. Keep sharing your information regularly for my future reference.
      Java Courses in chennai

    5. Thanks For Sharing Your Information Please Keep UpDating Us The Information Shared Is Very Valuable Time Went On Just Reading The Article Python Online Training Devops Online Training
      Aws Online Training DataScience Online Training
      Hadoop Online Training


    6. Excelr is providing emerging & trending technology training, such as for data science, Machine learning, Artificial Intelligence, AWS, Tableau, Digital Marketing. Excelr is standing as a leader in providing quality training on top demanding technologies in 2019. Excelr`s versatile training is making a huge difference all across the globe. Enable ?business analytics? skills in you, and the trainers who were delivering training on these are industry stalwarts. Get certification on "
      aws training institute in hyderabad"
      and get trained with Excelr.

    7. Great Article. Thank you for sharing! Really an awesome post for every one.

      IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Project Domains for IT It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

      Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
      Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    8. Thank you for excellent article.Great information for new guy like antimalware service executable

    9. Nice blog,I understood the topic very clearly,And want to study more like this.
      Data Scientist Course

    10. I like viewing web sites which comprehend the price of delivering the excellent useful resource free of charge. I truly adored reading your posting. Thank you!

      data science course

    11. Informative post, i love reading such posts. Read my posts here
      Laravel web development

    12. After reading this web site I am very satisfied simply because this site is providing comprehensive knowledge for you to audience.
      AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    13. Really impressed! Everything is very open and very clear clarification of issues. It contains truly facts. Your website is very valuable. Thanks for sharing.

      Data Science Course

    14. This post is very simple to read and appreciate without leaving any details out. Great work!

      Data Science Training

    15. By reading this article, many things have piled up in my mind which made me to think about it.
      SAP training in Kolkata
      SAP course in kolkata
      SAP training institute in Kolkata

    16. This content is very considered and well-thought. You are a distinctive thinker. You have put up the unique points to bring up specific points.
      SAP training in Mumbai
      SAP course in Mumbai
      SAP training institute Mumbai

    17. This is my first visit to your blog! We are a team of volunteers and new initiatives in the same niche. Blog gave us useful information to work. You have done an amazing job!
      PMP Certification Training in Bangalore

    18. I was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more.
      data science institute in hyderabad
      data analytics course
      business analytics course

    19. I really enjoy simply reading all of your weblogs. Simply wanted to inform you that you have people like me who appreciate your work. Definitely a great post. Hats off to you! The information that you have provided is very helpful.
      data science course
      data analytics course
      business analytics course in hyderabad


    20. Such a very useful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.
      360DigiTMG business analytics course
      360DigiTMG data analytics course
      360DigiTMG data science course

    21. I curious more interest in some of them hope you will give more information on this topics in your next articles.
      360digiTMG data scientist course

    22. I have gone through your article and I have found that all the points are unique and imaginative in my opinion. Hope to read some more like this article.

      SEO services in Kolkata
      SEO company in Kolkata
      SEO in Kolkata
      Best SEO services in Kolkata
      Best SEO company in Kolkata

    23. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.

      Simple Linear Regression

      Correlation vs Covariance

    24. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
      Correlation vs Covariance
      Simple linear regression
      data science interview questions

    25. I have truthfully never come across such overwhelmingly good piece of content. I agree with your valid points and your ideas. This piece of information is really great.
      Thank you so much.
      SAP training in Kolkata
      SAP course in kolkata

    26. I'm not among those readers that comments on every article often after reading it, but yours really bound me. I have come across a lot of interesting piece of information in this article that is bold.
      SAP training in Mumbai
      SAP course in Mumbai


    27. This is the information that I have been looking for. Great insights & you have explained it really well
      data science course

    28. The content that I normally go through nowadays is not at all in parallel to what you have written. It has concurrently raised many questions that most readers have not yet considered.

      SAP training in Kolkata
      SAP training Kolkata
      Best SAP training in Kolkata
      SAP course in Kolkata

    29. You have provided finicky information for a new blogger so it has turned out to be really obliging. Keep up the good work!
      Data Science training in Mumbai
      Data Science course in Mumbai
      SAP training in Mumbai