Please help! Problem with jdbc updateDate

pease

New Member
I am trying to update a Progress DB via JDBC driver. Can read records
and update string fields with no problem but cannot get date fields to
update properly. The sqlexception code is:

"java.sql.SQLException: [JDBC Progress Driver]:Invalid datetime format.
Error in parameter 1.This operation may have failed due to column aliasing on the select statement."

Here is the code:

import java.sql.*;
import java.net.*;
import java.net.URL;
import java.io.*;
import com.progress.sql.jdbc.*;

public class testdob
{
public static void main(String[] args)
{
try
{
String jdbcUrl = "jdbc:JdbcProgress:T:localhost:nemhr:nemhr";
Class.forName("com.progress.sql.jdbc.JdbcProgressDriver");
Connection con = DriverManager.getConnection (jdbcUrl, "uname",
"mypswd");

PreparedStatement ps = con.prepareStatement(
"SELECT * FROM pub.empmstr WHERE \"ss#\" = ?",
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ps.setString(1, "049468945");
ResultSet empData = ps.executeQuery();

ResultSetMetaData metadata = empData.getMetaData(); // Retrieve Column names
int columns = metadata.getColumnCount();
String[] columnNames = new String[columns];
for (int i=0;i<columns;i++)
{
columnNames = metadata.getColumnLabel(i+1);
}

empData.next(); // Position to record

for(int i = 0; i<columns; i++) // Print the record
System.out.println(columnNames + ": " + empData.getString(i+1));

empData.updateDate(5, // Change the date field
java.sql.Date.valueOf("1950-05-18"));
empData.updateRow(); // Update Resultset
}
catch(ClassNotFoundException cnfe)
{
System.err.println(cnfe);
}
catch(SQLException sqle)
{
System.err.println(sqle);
}
}
}


The exception occurs when the updateRow method executes. TIA for all
help from this august conclave of experts! ;-)
Regards,

Jonathan Pease-Strategic Planning Officer
**********************************************************
Norbert E. Mitchell Co., Inc.
The single source for all your energy needs--
Any time, Every time.
**********************************************************
 
Top