| Author |
Getting java.sql.SQLException: ORA-01465: invalid hex number
|
Mahi Rao
Greenhorn
Joined: Apr 02, 2008
Posts: 3
|
|
Please help me, i am getting this error when i am converting String in to byte[] and inserting in to database of column type BLOB. My code is like this, String name = "some text"; byte[] byte = name.getBytes(); System.out.println(byte); \\ here i am getting like this [B@63e563 So, whenever i am trying to insert it into db column of type BLOB i am getting the following error ORA-01465: invalid hex number ; nested exception is java.sql.SQLException: ORA-01465: invalid hex number Caused by: java.sql.SQLException: ORA-01465: invalid hex number at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288) at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:207) at oracle.jdbc.driver.T4CStatement.executeForRows(T4CStatement.java:946) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1169) at oracle.jdbc.driver.OracleStatement.executeInternal(OracleStatement.java:1688) at oracle.jdbc.driver.OracleStatement.execute(OracleStatement.java:1654) at org.springframework.jdbc.core.JdbcTemplate$1ExecuteStatementCallback.doInStatement(JdbcTemplate.java:368) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:342) at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:375) at com.dbxcel.webapp.action.ClassName.testNote(ClassName.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at org.springframework.test.ConditionalTestCase.runBare(ConditionalTestCase.java:69) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
|
 |
Anubhav Anand
Ranch Hand
Joined: May 18, 2007
Posts: 341
|
|
Mahi Rao, Welcome to JavaRanch. The official explanation by oracle is
ORA-01465: invalid hex number Cause: In an UPDATE statement following a SELECT FOR UPDATE, part of the ROWID contains invalid characters. ROWID must be expressed in the proper and expected format for ROWID and within quotes. Action: Enter the ROWID just as it was returned in the SELECT FOR UPDATE.
Seems, you got some problem with the id you are using. Also, if it doesn't work try inserting using a prepared statement. In the prepared statement set the id and blobfile. This will disallow any discrepancy in id field. Hope that helps
|
 |
Mahi Rao
Greenhorn
Joined: Apr 02, 2008
Posts: 3
|
|
Anubhav, Can you send me any example piece of code?
|
 |
Anubhav Anand
Ranch Hand
Joined: May 18, 2007
Posts: 341
|
|
An example can be like : [ April 03, 2008: Message edited by: Anubhav Anand ]
|
 |
Mahi Rao
Greenhorn
Joined: Apr 02, 2008
Posts: 3
|
|
|
thanks Anubhav
|
 |
 |
|
|
subject: Getting java.sql.SQLException: ORA-01465: invalid hex number
|
|
|