Good morning.
Create a class in the Eclipse-Kepler IDE to feed a Database with a text file, in the project manage the ojdbc14 JDK 1.7 driver for the connection. Inside eclipse everything works correctly , but when compiling it with Maven and executing the .jar it sends me the following error:
"Not suitable driver found for jdbc: oracle: thin: @ xxx.xxx.xxx.xxx: xxxx: BDNAME Failed to read the java.lang.NullPointerException file. "
I occupy a class for the connection:
public class DespachadorBD {
public static final String DB_DRIVER = "oracle.jdbc.driver.OracleDriver";
public static final String DB_CONNECTION = "jdbc:oracle:thin:@192.xxx.xxx.xxx:XXXX:DBNAME";
public static final String DB_USER = "User";
public static final String DB_PASSWORD = "Pass";
}
...
...
private static Connection getDBConnection() {
Connection dbConnection = null;
try {
Class.forName(DB_DRIVER);
} catch (ClassNotFoundException e) {
System.out.println(e.getMessage());
}
try {
dbConnection = DriverManager.getConnection(
DB_CONNECTION, DB_USER,DB_PASSWORD);
return dbConnection;
} catch (SQLException e) {
System.out.println(e.getMessage());
}
return dbConnection;
}
}
Thank you in advance for your support and comments. Greetings.