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
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Reply 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to update TimeStamp in Oracle database
 
Similar Threads
Code for crawling websites hangs without any exception
write a bytearray to an oracle db
write a bytearray to an oracle db
Performace of Updatable resultset
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters