【发布时间】:2015-04-11 22:23:05
【问题描述】:
public TestDate()
{
fnDbConnect();
try
{
String sql = "SELECT ledate FROM tblTestDate WHERE (ledate REGEXP '^..........$')";
resultSet = st.executeQuery(sql);
while (resultSet.next())
{
String strr = resultSet.getString("ledate");
System.out.println("strr: " + resultSet.getString("ledate"));
}
System.out.println("After");
}
catch(SQLException sqlException)
{
sqlException.printStackTrace();
System.exit(1);
}
fnDbClose();
}
在我的数据库表中,我有如下值:11/12/1990, 05/08/2001 存储。正则表达式(我只是出于测试目的使用它)应该给我存储的所有内容。
我得到的错误:
net.ucanaccess.jdbc.UcanaccessSQLException:意外令牌:REGEXP 必填:)
【问题讨论】:
-
我认为 MS Access 不支持
regexp作为运算符。
标签: java sql regex ms-access ucanaccess