Advertisement
Guest User

Untitled

a guest
Apr 11th, 2016
336
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. Se ha producido un error al realizar la operación solicitada:
  2.  
  3. ORA-00604: error occurred at recursive SQL level 1
  4. ORA-12705: Cannot access NLS data files or invalid environment specified
  5. 00604. 00000 - "error occurred at recursive SQL level %s"
  6. *Cause: An error occurred while processing a recursive SQL statement
  7. (a statement applying to internal dictionary tables).
  8. *Action: If the situation described in the next error on the stack
  9. can be corrected, do so; otherwise contact Oracle Support.
  10. Código de proveedor 604
  11.  
  12. package py.conexion;
  13.  
  14. import java.sql.Connection;
  15. import java.sql.DriverManager;
  16. import java.sql.SQLException;
  17. import java.util.logging.Level;
  18. import java.util.logging.Logger;
  19.  
  20. public class Conexion {
  21.  
  22. private static String ORACLE_DRIVER = "oracle.jdbc.driver.OracleDriver";
  23.  
  24. introducir el código aquí
  25. protected String host = "127.0.0.1";
  26. protected String port = "1521";
  27. protected String dbname = "xe";
  28. protected String user = "usuario";
  29. protected String password = "password";
  30.  
  31.  
  32. private static Logger logger = Logger.getLogger("DBAccessOracle");
  33. private Connection conn;
  34.  
  35. public Connection getConnection() throws SQLException {
  36. try {
  37. Class.forName(ORACLE_DRIVER);
  38. } catch (ClassNotFoundException e) {
  39. logger.log(Level.SEVERE, "ClassNotFoundException: " + e.getMessage());
  40. }
  41.  
  42. String url = "jdbc:oracle:thin:@" + host + ":" + port + "/" + dbname; // SERVICE
  43.  
  44. System.out.println(url);
  45. conn = DriverManager.getConnection(url, user, password);
  46. return conn;
  47.  
  48. }
  49.  
  50. public static void main(String[] args) {
  51. try {
  52. Conexion c = new Conexion();
  53. System.out.println(c.getConnection().getMetaData().getDatabaseMajorVersion());
  54. } catch (SQLException e) {
  55. e.printStackTrace();
  56. }
  57. }
  58.  
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement