ormlite-jdbc icon indicating copy to clipboard operation
ormlite-jdbc copied to clipboard

Oracle support

Open smil2k opened this issue 8 years ago • 4 comments

Hi,

You can try oracle support using Oracle XE under this page: http://www.oracle.com/technetwork/database/database-technologies/express-edition/downloads/index.html

It is free of charge.

It runs in docker also, makes installation much easier: https://hub.docker.com/r/wnameless/oracle-xe-11g/

Cheers,

Tamas

smil2k avatar Sep 29 '17 17:09 smil2k

For example, Oracle not supported "CREATE IF NOT EXIST":

TableUtils.createTableIfNotExists(cs, Account.class);

this returns error:

ORA-00955: name is already used by an existing object

a-langer avatar Feb 13 '19 10:02 a-langer

Oracle does not support keyword "LIMIT". Using "limit" method:

limit(Integer maxRows)

results in an error. Instead, oracle supports ROWNUM:

select * from Accouns where ROWNUM <= 5

or FETCH

select * from Accouns FETCH NEXT 5 ROWS ONLY;

FETCH can be used in the "orderByRaw" method.

orderByRaw("ID DESC FETCH NEXT 5 ROWS ONLY")

ormlite does not take into account these differences.

a-langer avatar Feb 15 '19 05:02 a-langer

Sorry for the long delay on this. Thanks. I'll take a look.

j256 avatar Nov 19 '20 16:11 j256

I coded this simple backup in the meantime :

public class CustomOracleDatabaseType extends OracleDatabaseType {

    @Override
    public boolean isLimitSqlSupported() {
        return false;
    }
}

benoit-dubreuil avatar Jul 19 '21 20:07 benoit-dubreuil