Código:
public int Codigo(){
MysqlConectar conn = new MysqlConectar();
conn.connectar();
String a;
int b;
try {
conn.consulta("SELECT max(codigo) as maxcod from oferta;");
b = conn.getRs().getInt("maxcod");
if(b.next())
return (b+1);
} catch (SQLException e) {
return -1;
}
}
Segun mis fuentes y lo que dice ahi, hay que abrir el resultSet[b.next()]
creo que este codigo te puede funcionar.
saludos