Invalid column type
hi guys,
The autoincrement id doesnt work for retrieving,
it has insert data into db. But not getting retrieved.
error-
Invalid column type: getInt not implemented for
class oracle.jdbc.driver.T4CRowidAccessor
publicvoid registerUser(String name, String title, String email,
Integer telephone, String userName, String password)throws DaoException{
String addUser =
"insert into users(name,title,email,telephone,userName,password) values(?,?,?,?,?,?)";
try{
System.out.println("-getting datasource for connection-");
getDataSource();
if(conn ==null){
conn = dataSource.getConnection();
System.out.println("--got connection from pool-");
}
if(conn!=null){
System.out.println("-about to execute insert stmt--");
ps = conn.prepareStatement(addUser,PreparedStatement.RETURN_GENERATED_KEYS);
ps.setString(1,name);
ps.setString(2,title);
ps.setString(3,email);
ps.setInt(4,telephone);
ps.setString(5,userName);
ps.setString(6,password);
ps.executeUpdate();
/*
* get the ResultSet object
*/
if(rs ==null){
rs = ps.executeQuery();
rs = ps.getGeneratedKeys();// stores generated keys for retrieving autoIncrementKey
try{
if(rs.next()){
int prikey = rs.getInt(1);
System.out.println(prikey);
}
}
catch(SQLException e){
thrownew DaoException("Error retrieving autoIncrementKey",e);
}
}
Any ideas?
Tnx

