mercredi 3 septembre 2014

Erro conection JDBC of App JSP in Openshift


Vote count:

0




I'm three days trying a solution for jdbc mysql connection from my app on OpenShift. It's a simple app, JSP. Not JSF and not Hibernate.


The error that shows me is:




java.lang.NullPointerException


com.brazil.jdbc.UsuarioDAO.autenticar (UsuarioDAO.java: 186)




This line of code is what I use to create the connection object.


I've used the "port-forward rhc -a teste5" command And tb the "export" within the rhc, to obtain the variables.


I've tried to modify the following ways below, but all without success:




con= DriverManager.getConnection("jdbc:mysql://127.7.202.2:3306/teste5", "adminXnZRJkD", "**");


con= DriverManager.getConnection("jdbc:http://mysql${OPENSHIFT_MYSQL_DB_HOST}:${OPENSHIFT_MYSQL_DB_PORT}/${OPENSHIFT_APP_NAME}");


con=DriverManager.getConnection("jdbc:mysql://adminXnZRJkD:**@127.7.202.2:3306");


con=DriverManager.getConnection("jdbc:http://mysql${OPENSHIFT_MYSQL_DB_URL}");


con=DriverManager.getConnection("jdbc:${OPENSHIFT_MYSQL_DB_URL}");




My app was created as jbossews-2.0 with phpmyadmin and mysql-5.5-4. I do not know whether to configure an external file.


Please someone see a solution?



asked 35 secs ago







Erro conection JDBC of App JSP in Openshift

Aucun commentaire:

Enregistrer un commentaire