The following statement cannot be executed with JDBC:
{code}
Connection connection = create().getConnection();
PreparedStatement s = connection.prepareStatement(
select DATE_ADD('2010-01-01', INTERVAL ? YEAR_MONTH));
s.setString(1, +1-6);
s.executeQuery();
{code}
It can be executed without problems in CUBRID Manager. It seems that only simple interval types are supported in JDBC. The following works:
{code}
Connection connection = create().getConnection();
PreparedStatement s = connection.prepareStatement(
select DATE_ADD('2010-01-01', INTERVAL ? DAY));
s.setString(1, 1);
s.executeQuery();
{code}
And so does this:
{code}
Connection connection = create().getConnection();
PreparedStatement s = connection.prepareStatement(
select DATE_ADD('2010-01-01', INTERVAL '+1-6' YEAR_MONTH));
s.executeQuery();
{code}