No suitable driver found MariaDB

-4

I'm trying to insert a tuple of data into a DB using JDBC through a web page.

I made a ConnectionFactory class to encapsulate the connection with MariaDB, I imported the driver for the classpath, I tried inserting some data with a Teste class with a Main and worked recognized the driver normally. However, when I use it in the servlet it throws the error:

Ihavealreadyputthedriverjarinsidethetomcatlibfolder,IalreadyputitinsidetheWEB-INF/libintheprojectdeploybutnothing.I'vealreadyput:

Class.forName("com.mysql.jdbc.Driver");    

at the factory but to no avail.

    
asked by anonymous 11.09.2018 / 21:08

1 answer

1

It is no longer necessary to specify the Class.forName since Java SE 6 . However, if you wish to declare, in the MariaDB specification says the correct class: org.mariadb.jdbc.Driver .

    
12.09.2018 / 19:45