-3
I am trying to insert a tuple of data into a DB using JDBC through a web page.
I took a class ConnectionFactory
to encapsulate the connection with Mariadb, I imported the driver to the classpath, tested by entering some data with a class Teste
with a Main
and it worked, recognized the driver as normal. However, when I use Servlet it shows the error:
I already put the driver jar inside the Tomcat lib folder, I already put inside the WEB-INF/lib
on the project deploy but nothing. I’ve also put:
Class.forName("com.mysql.jdbc.Driver");
in Factory but unsuccessfully.
mariadb uses the same driver as Mysql? Also, the port is right? This port is the default for Mysql.
– igventurelli
Check the port that mariadb is running and the name of the table that is trying to enter the data, since the error says that there is no such information.
– Guilherme Caruso
So I made one. jar to run per command line using the connection and it worked, I entered several data... it is only when I deploy in Tomcat that it works bad, even using the same driver. Somehow Tomcat is not recognizing the driver, even though it is in the project lib and Tomcat itself
– Gerson Ferreira Junior