Estou com esse erro que está me tirando o sono “ORA-01843: not a valid month”
Já tentei passar a data como sql.Date, String e dá sempre o mesmo erro.
Quando chamo a procedure via PL/SQL Developer funciona perfeitamente.
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.text.ParseException;
public class Main {
public static void main(String[] args) throws ParseException{
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
String url = "jdbc:oracle:thin:@172.29.0.6:5100:BASE";
Connection con = DriverManager.getConnection(url, "user", "password");
CallableStatement cs = con.prepareCall("{ call sCtCriaLancInterface(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) }");
cs.setInt(1, 4);
cs.setString(2, null);
cs.setString(3, null);
cs.setInt(4, 5);
cs.setString(5, null);
cs.setString(6, null);
cs.setTimestamp(7, new Timestamp(new java.util.Date().getTime()));
cs.setString(8, "O");
cs.setInt(9, 215);
cs.setString(10, "4312002");
cs.setString(11, null);
cs.setInt(12, 32);
cs.setString(13, null);
cs.setString(14, "D");
cs.setString(15, null);
cs.setString(16, null);
cs.setTimestamp(17, new Timestamp(new java.util.Date().getTime()));
cs.setTimestamp(18, new Timestamp(new java.util.Date().getTime()));
cs.setDouble(19, 100.01);
cs.setString(20, null);
cs.setString(21, null);
cs.setInt(22, 34);
cs.setString(23, null);
cs.setString(24, null);
cs.registerOutParameter(25, java.sql.Types.NUMERIC);
cs.registerOutParameter(26, java.sql.Types.NUMERIC);
cs.registerOutParameter(27, java.sql.Types.VARCHAR);
cs.execute();
System.out.println(cs.getInt(25));
System.out.println(cs.getInt(26));
System.out.println(cs.getString(27));
System.out.println(new Timestamp(new java.util.Date().getTime()));
} catch (ClassNotFoundException ex) {
ex.printStackTrace();
} catch (SQLException ex) {
ex.printStackTrace();
}
}
}
Alguém tem idéia do que possa ser?