File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes How to update TimeStamp in Oracle database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to update TimeStamp in Oracle database" Watch "How to update TimeStamp in Oracle database" New topic
Author

How to update TimeStamp in Oracle database

somenath chatterjee
Greenhorn

Joined: Mar 20, 2008
Posts: 16
Hi all,
I want to copy date from one table to another with column type like eg: BLOB, CLOB, RAW, TimeStamp data. But when i am going to update timestamp datatype in target table its giving error:

Internal Error: Unable to construct a Datum from the specified input

giving some code for understanding clearly-

rs = stmt.executeQuery("SELECT COUNT(*) AS rowcount FROM "+ srcTable);
while(rs.next()){
rowCount = rs.getRow();

rSet = stmt.executeQuery("SELECT * FROM "+srcTable);
rsTarget = stmtTarget.executeQuery("SELECT "+srcColumn+" FROM "+tarTable);
while (rSet.next() && rsTarget.next()) {
if(srcColType.equals("BLOB")){

// this blob data successfily updating in target table try {
blobVal = rSet.getBlob(srcColumn);
rsTarget.updateBlob(srcColumn, blobVal);
} catch (Exception e) {
e.printStackTrace();}
/* this part showing error message Internal Error: Unable to construct a Datum from the specified input*/
try {
time = rSet.getTimestamp(srcColumn);
rsTarget.updateTimestamp(srcColumn, time);
} catch (Exception e) {
e.printStackTrace();}
rsTarget.updateRow();
}
}

Please Let me know if you faced similar problem and the solution if available
 
jQuery in Action, 2nd edition
 
subject: How to update TimeStamp in Oracle database
 
Similar Threads
write a bytearray to an oracle db
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters
Performace of Updatable resultset
Code for crawling websites hangs without any exception
write a bytearray to an oracle db