I am getting the following error when connecting to the derby database (test1) in netbeans 8.0. please give some suggestions to fix this error.
Unable to connect. Cannot establish a connection to jdbc:derby://localhost:1527/test1 using org.apache.derby.jdbc.ClientDriver (DERBY SQL error: SQLCODE: -1, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'test1' with class loader sun.misc.Launcher$AppClassLoader#631d75b9, see the next exception for details.::SQLSTATE: XSLANDatabase at C:\Users\Chirath.netbeans-derby\test1 has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.10.).
Related
First, I have downloaded microsoft jdbc driver(sqljdbc42.jar) for Sqlserver and added it to path. And I can use it to connect to my local MySQL database using the following codes:
database('**','**','**','com.mysql.jdbc.Driver','jdbc:mysql://localhost:3306/')
But I cannot connect to a remote SQLServer with error message: Unable to find JDBC driver. The codes are:
database('**','**','**','com.microsoft.sqlserver.jdbc.SQLServerDriver','jdbc:sqlserver://**')
I'm trying to evaluate icCube and I have a problem when I try to connect a PostgreSQL datasource. When I test the connection I get an error message about PostgreSQL driver missing:
Failed to establish the connection due to the error: JDBC driver class 'org.postgresql.Driver' not found in the classpath
I've checked the lib directory of icCube and it has postgresql-9.4.1207.jre7.jar bundled in the release, is there anything I'm missing?
To fix this, I had to add the PostgreSQL JDBC driver to bin/icCube.sh in the JDBC section:
CLASSPATH="$CLASSPATH:$ICCUBE/lib/postgresql-9.4.1207.jre7.jar"
I was using Glassfish4 with Eclipse and derby-10.6 with JEE. Everything was working fine. Then for some tutorials I switched to Netbeans8.1 which had Glassfish4.1.1 and derby-10.12. Now I am back to Eclipse and want to start from where I left. Meanwhile database created by derby-10.6 is upgraded by 10.12. How can I change settings in Glassfish4 so that it can connect to the database? I am guessing I need to change something with ConnectionPool.
The error I am getting is:
Error occurred during deployment: Exception while deploying the app [ejb] : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: DERBY SQL error: ERRORCODE: 0, SQLSTATE: XJ040, SQLERRMC: Failed to start database 'EmployeeDB' with class loader sun.misc.Launcher$AppClassLoader#61bbe9ba, see the next exception for details.::SQLSTATE: XSLANDatabase at C:...\db-derby-10.6.2.1-bin\bin\EmployeeDB has an incompatible format with the current version of the software. The database was created by or upgraded by version 10.9. Error Code: 0. Please see server.log for more details.
Note that, I don't have derby-10.9.
I'm trying to make maven project which should work with oracle database.
First I tried to connect database to DB Browser in IDEA, but I've no idea how to use it in code if it's even possible. However I use following java code:
Base.open("oracle.jdbc.driver.OracleDriver", "jdbc:oracle:thin:#localhost:1521:XE", "SYSTEM", "pass");
it doesn't run with error Failed to connect to JDBC URL:
jdbc:oracle:thin:#localhost:1521:XE Caused by: java.sql.SQLException: ORA-00604: error occurred at recursive SQL level 1
ORA-12705: Cannot access NLS data files or invalid environment specified.
But according to connection info in DB browser it's written right. What's going wrong?
Problem solved by following code before Base.open(...);: Locale.setDefault(Locale.ENGLISH);
we are using spring with c3p0 as the database pool, we use oracle 10g as the database.
when we launch the application,it continues show following error
2012-5-7 13:12:43 com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask run
Warning: Failed to destroy resource: com.mchange.v2.c3p0.impl.NewPooledConnection#20af46
java.sql.SQLException: Some resources failed to close properly while closing com.mchange.v2.c3p0.impl.NewPooledConnection#20af46
2012-5-7 14:45:51 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
Info: [c3p0] Exceptions occurred while trying to close a PooledConnection's resources normally.
2012-5-7 14:45:51 com.mchange.v2.c3p0.impl.NewPooledConnection logCloseExceptions
Info: [c3p0] NewPooledConnection close Exception.
java.sql.SQLException: More data can not be read from the socket
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:146)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:208)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:1123)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:1075)
at oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:106)
at oracle.jdbc.driver.T4CConnection.logoff(T4CConnection.java:465)
at oracle.jdbc.driver.PhysicalConnection.close(PhysicalConnection.java:1203)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:549)
at com.mchange.v2.c3p0.impl.NewPooledConnection.close(NewPooledConnection.java:234)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.destroyResource(C3P0PooledConnectionPool.java
at com.mchange.v2.resourcepool.BasicResourcePool$1DestroyResourceTask.run(BasicResourcePool.java:964)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
In oracle trace file,we found the following error
*** 2012-05-07 11:50:56.421
ksedmp: internal or fatal error
ORA-07445: An unexpected error: core dump [ACCESS_VIOLATION] [_evaopn2+153] [PC:0x1BBDFA9] [ADDR:0x0] [UNABLE_TO_READ] []
Current SQL statement for this session:
Is the oracle error cause the above reason.we take a lot of time to find the problem but we have not found the problem. before we are using oracle 9i,and it did not have the problem.recently we upgrade to oracle 10g.where will be the problem? any idea will be very helpful.thanks!
the c3p0 we used is com.springsource.com.mchange.v2.c3p0-0.9.1.2.jar.