I have used below code to replace a string by another string in executeUpdate method.The code is:
try
{
Connection cn=null;Statement st=null;
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String constring="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=D:sandeep\\copy of abcdef.mdb;";
cn=DriverManager.getConnection(constring, "", "");
st=cn.createStatement();
String sql="UPDATE temp SET mobile = Replace(mobile, '-', '')";
st.executeUpdate(sql.toString());
}
catch(Exception ex){System.out.println(ex);
}
The exception is:
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Undefined function 'Replace' in expression.
CallableStatement?