I have a Maven Module project of Liferay 7, which I want to implement a connection to Oracle through the OJDBC6, I have my connection which is the following:
public static Connection getConnection() {
if (connection != null) {
return connection;
} else {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
connection = DriverManager.getConnection("miURL", "miUsuario",
"miPass");
} catch (ClassNotFoundException cnfe) {
System.out.println(cnfe);
} catch (SQLException sqe) {
System.out.println(sqe);
}
return connection;
}
}
Obviously I have a DAO class where I use my connection, and when I use my DAO in my controller I get the following connection error:
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I have searched many pages and implemented some of these solutions:
Among other similar ... And until now nothing has worked for me, someone will have some other solution?