java.sql.SQLException: Smart-large-object error informix - java

I am trying to insert blob into table in informix database using JDBC query. However am getting this error:
java.sql.SQLException: Smart-large-object error.
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:413)
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3494)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3807)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2610)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2526)
at com.informix.jdbc.IfxSqli.executeCommand(IfxSqli.java:940)
at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:303)
at com.informix.jdbc.IfxStatement.c(IfxStatement.java:1273)
at com.informix.jdbc.IfxPreparedStatement.executeUpdate(IfxPreparedStatement.java:421)
at etaxarchive.FillDataManager.insertIntoTable(FillDataManager.java:196)
at etaxarchive.FillDataManager.fillTableData(FillDataManager.java:112)
at etaxarchive.ETaxArchiveManager.archiveData(ETaxArchiveManager.java:89)
at etaxarchive.ETaxArchive.main(ETaxArchive.java:33)
Caused by: java.sql.SQLException: ISAM error: Lock Timeout Expired
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:413)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3812)
... 10 more
Does anybody knows how to resolve this problem?

I was getting a BLOB which using this line of code:
InputStream binaryStream = rs.getBlob(i).getBinaryStream();
I change it to this line of code:
InputStream test = rs.getBinaryStream(i);
and I was not getting this exception again.
Maybe this was not the problem, but for me it works.

Related

H2: JdbcSQLException: This CLOB or BLOB reference timed out

Upon using h2 in java (calling getBytes function) I'm getting the following error. Google didn't get me anywhere. I wonder if anyone has clues what's going on.
Caused by: org.h2.jdbc.JdbcSQLException: This CLOB or BLOB reference timed out: "533668/-3" [90039-190]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:345)
at org.h2.message.DbException.get(DbException.java:179)
at org.h2.message.DbException.get(DbException.java:155)
at org.h2.store.LobStorageMap.getInputStream(LobStorageMap.java:287)
at org.h2.value.ValueLobDb.getInputStream(ValueLobDb.java:384)
at org.h2.value.ValueLobDb.getBytesNoCopy(ValueLobDb.java:318)
at org.h2.value.ValueLobDb.getBytes(ValueLobDb.java:304)
at org.h2.jdbc.JdbcResultSet.getBytes(JdbcResultSet.java:1059)
at edu.illinois.cs.cogcomp.srl.caches.SentenceDBHandler$1.next(SentenceDBHandler.java:214)
This error message can occur if you have a long running transaction for instance. You can increase the timeout by setting the LOB_TIMEOUT property on the database connection.
Database setting LOB_TIMEOUT (default: 300000, which means 5 minutes).
The number of milliseconds a temporary LOB reference is kept until it times out. After the timeout, the LOB is no longer accessible using this reference.
https://www.h2database.com/javadoc/org/h2/engine/DbSettings.html#LOB_TIMEOUT

Error Creating Table java.sql.SQLException: JDBC LLR, table verify failed for table 'QQE4D.WL_LLR_I0_LTAPP107', failed to create table

I have an issue with weblogic and jdbc configuration. We are using weblogic 12c and jdbc to connect to oracle.
I am getting an error while creating a table with name WL_LLR_ADMINSERVER.
Below is the error
Failing reason: javax.transaction.SystemException: Failed to call registerLoggingResourceTransactions() weblogic.transaction.loggingresource.LoggingResourceException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDBC LLR, table verify failed for table 'QQE4D.WL_LLR_I0_LTAPP107', failed to create table javax.transaction.SystemException: Failed to call registerLoggingResourceTransactions() weblogic.transaction.loggingresource.LoggingResourceException: weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDBC LLR, table verify failed for table 'QQE4D.WL_LLR_I0_LTAPP107', failed to create table.
The query being fired to create the table is
JDBC loggging last resource (LLR) connection pool KernelDataSource did not find its table and is creating a new one using the following SQL:
CREATE TABLE QQE4D.WL_LLR_I0_LTAPP107 (XIDSTR VARCHAR(40) NOT NULL PRIMARY KEY, POOLNAMESTR VARCHAR(64), RECORDSTR VARCHAR(1000))>
The code congigured for the datasource in xml file is
<jdbc-system-resource>
<name>KernelDataSource</name>
<target>cluster</target>
<descriptor-file-name>jdbc/KernelDataSource-int-jdbc.xml</descriptor-file-name>
The datasource xml contains the connection url, driver name, username and the encrypted password details.
I have seen some errors like below but for my case i am not able to create the table itself so i could find the exact solution for my issue.
weblogic.transaction.loggingresource.LoggingResourceException: java.sql.SQLException: JDBC LLR, table verify failed for table 'DEV_SOAINFRA.WL_LLR_ADMINSERVER', row 'JDBC LLR Domain//Server' record had unexpected value 'osb_domain//AdminServer' expected 'osb_cluster_domain//AdminServer' ONLY the original domain and server that creates an LLR table may access it.
Even i don't see these datasources linked to this server in weblogic console as well under monitoring tab. I guess we can see once this issue gets resolved.
I have seen that the atable name should not exceed 18 characters and my table WL_LLR_SERVERNAME is WL_LLR_I0_LTAPP107 which is exactly 18 characters and this is also not an issue.
Can someone please help me in this regard.

JasperReports JDBC TDS: internal error 2

I am trying to fill a jrxml file using JasperCompileManager and I am receiving the following error:
net.sf.jasperreports.engine.JRException: Error executing SQL statement for : MSWST
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:240)
at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1114)
at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:691)
at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1288)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:907)
at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:852)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87)
at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:446)
at net.sf.jasperreports.engine.JasperFillManager.fillToFile(JasperFillManager.java:228)
at net.sf.jasperreports.engine.JasperFillManager.fillToFile(JasperFillManager.java:124)
at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:666)
at DbReportFill.generateReport(DbReportFill.java:57)
at DbReportFill.main(DbReportFill.java:160)
Caused by: java.sql.SQLException: TDS: internal error 2
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:372)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2988)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2421)
at net.sourceforge.jtds.jdbc.TdsCore.getMoreResults(TdsCore.java:671)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:505)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:1029)
at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:233)
... 12 more
The connection looks like this:
connection = DriverManager.getConnection(
"jdbc:jtds:sybase://127.0.0.1:2631/serverName", "DBA",
"password");
I had heard that this may ocurre do to the driver, but i get the same error when I am using jconn3.

Embeded Firebird Database and Hibernate

I am trying to use the Firebird embeded DB together with Hibernate, but I get the following error when trying to create the database:
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544344. I/O error during "CreateFile (open)" operation for file "D:\DB\FIREBIRD.FDB"
Error while trying to open file
null
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:123)
at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126)
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:204)
at org.hibernate.internal.AbstractSessionImpl$NonContextualJdbcConnectionAccess.obtainConnection(AbstractSessionImpl.java:292)
at org.hibernate.engine.jdbc.internal.LogicalConnectionImpl.obtainConnection(LogicalConnectionImpl.java:214)
... 32 more
Caused by: org.firebirdsql.gds.GDSException: I/O error during "CreateFile (open)" operation for file "D:\DB\FIREBIRD.FDB"
Error while trying to open file
null
at org.firebirdsql.gds.impl.jni.JniGDSImpl.native_isc_attach_database(Native Method)
at org.firebirdsql.gds.impl.jni.BaseGDSImpl.iscAttachDatabase(BaseGDSImpl.java:158)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:105)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:490)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
... 36 more
What I have done until now:
I've set the hibernate configuration.
Driver = "org.firebirdsql.jdbc.FBDriver",
Dialect = "org.hibernate.dialect.FirebirdDialect",
Url = "jdbc:firebirdsql:embedded:D:\DB\FIREBIRD.FDB",
I have added the jaybird-full jar to my classpath.
I have added jaybird22.dll, fbembed.dll (the whole folder) to my path.
The dlls seem to be loaded since if I delete the dlls I get and exception telling me that jaybird22.dll cannot be found.
Any idea what could be wrong ?
It seems the step I was missing was creating the database file manually:
FBManager manager = new FBManager(GDSType.getType("EMBEDDED"));
manager.start();
manager.createDatabase(myDbFile, username, password);
manager.stop();

could not get database metadata java.sql.SQLException:

I am using hibernate sharedFactory for database updation.
When am trying to do one updation am getting the following errors on log:
2011-09-01 16:17:50,406 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:134:execute) - could not get database metadata
java.sql.SQLException: Connections could not be acquired from the underlying database!
2011-09-01 16:32:05,734 ERROR (org.hibernate.tool.hbm2ddl.SchemaUpdate:165:execute) - could not complete schema update
java.sql.SQLException: Connections could not be acquired from the underlying database!
And the exception is exactly throwing on this line of code..
sessionFactoryShard = shardedConfig.buildShardedSessionFactory();
Can anyone tell why this error occurs?

Categories

Resources