This week's book giveaways are in the iOS and Features new in Java 8 forums.
We're giving away four copies each of Barcodes with iOS: Bringing together the digital and physical worlds and Core Java for the Impatient and have the authors on-line!
See this thread and this one for details.
The moose likes JDBC and Relational Databases 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 Barcodes with iOS this week in the iOS forum
or Core Java for the Impatient in the Java 8 forum!

JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
 
Consider Paul's rocket mass heater.
 
subject: How to update TimeStamp in Oracle database