Olá amigos! Mais uma dúvida básica…
Tenho o seguinte codigo:
String url = "jdbc:oracle:thin:@127.0.0.1:1521:XE";
String driver = "oracle.jdbc.driver.OracleDriver";
Connection conn;
try {
Class.forName(driver);
conn = DriverManager.getConnection(url, "berto", "berto");
Statement st = conn.createStatement();
String insert = "INSERT INTO agenda VALUES (245,'" + nome + "','" + telefone1 + "','" + telefone2 + "','" + telefone3 + "');";
try {
st.executeUpdate(insert);
} catch (Exception ex) {
%><%="Opa não executou a query"%><%
}
E ele sempre cai no catch… no lugar do INSERT já testei com SELECT e funcionou numa boa, mostrando o resultado e NÃO utilizando executeUpdate e sim executeQuery, que tbm testei o INSERT com executeQuery e tbm não funcionou!!!
Socorro!!!
Obrigado desde de já, pessoal!
berto