Driver modified for JDeveloper+ADF communication

Поиск
Список
Период
Сортировка
Искать

Driver modified for JDeveloper+ADF communication

От:
Javier Caballero <jcaballero@empretal.com>
Дата:
Hi.

I'm doing a program with JDeveloper+ADF and Postgre and was having 
problems with the update sentence (created automatically by JDeveloper). 
After some research, found the problem in the SQL sentence. Postgre 
don't accept alias in a UPDATE query and JDeveloper sends it.

I have modified the driver to eliminate the alias, here's a new method 
to include in AbstractJdbc2Statement.java:

private String eliminaAlias(String sql)
    {
        String nuevaSQL= sql;
        StringTokenizer cadenaTokens=new StringTokenizer(sql);
        String vTokens[]= new String[cadenaTokens.countTokens()];
        int j= 0;
        String temp;
        while(cadenaTokens.hasMoreTokens())
        {
            temp= cadenaTokens.nextToken();
            vTokens[j]= temp;
            j++;
        }
       
        //     La sentencia tiene un alias, hay que eliminarlo
        if((vTokens[1].toLowerCase()).equals(vTokens[2].toLowerCase()) 
|| (vTokens[1].toLowerCase()).equals("public."+vTokens[2].toLowerCase()))
        {
            nuevaSQL= "";
            for(int i=0;i

Re: Driver modified for JDeveloper+ADF communication

От:
Kris Jurka <books@ejurka.com>
Дата:


On Tue, 19 Jun 2007, Javier Caballero wrote:

> I'm doing a program with JDeveloper+ADF and Postgre and was having problems 
> with the update sentence (created automatically by JDeveloper). After some 
> research, found the problem in the SQL sentence. Postgre don't accept alias 
> in a UPDATE query and JDeveloper sends it.

PG accepts update aliases in version 8.2+.  So a better solution is 
probably just to upgrade.

Kris Jurka
FAQ