//I open a connection, loading the driver (I don't put try{}catch(){}):
Class.forName("interbase.interclient.Driver");
Connection
Conexion=DriverManager.getConnection("jdbc:interbase://127.0.0.1/C:/COSA.gdb","pepito","pepito");
//make a Statement
Statement stmArticulos= conecta.getConexion().createStatement();
//make a query (Ok the database desing sucks but isn't my desing)
//change the dialect
stmArticulos.executeQuery("SET SQL DIALECT 1;");
ResultSet rsArticulos=stmArticulos.executeQuery("select
PK_ARTICULO,MODIFICACION,REFERENCIA,NOMBRE,TIPO_IVA,TIPO_RECARGO,PVP1,PVP1_IVA,PVP2,PVP2_IVA,PVP3,PVP3_IVA,PVP4,PVP4_IVA
from articulos")
//and try to move arround the resulset
do{
System.out.println(this.getRsArticulos().getString(1));
}while (this.getRsArticulos().next());
and obtain a dialect error
Ok I read some webs and the problem must be in the Dialect
If Dialect is set to 3,2 or 1 I obtain this exception:
interbase.interclient.SQLException: [interclient][interbase] Dynamic SQL
Error
SQL error code = -104
Token unknown - line 1, char 4
SQL
If i not set dialect removing the line stmArticulos.executeQuery("SET
SQL DIALECT 1;"); I obtain this exception:
interbase.interclient.SQLException: [interclient][interbase] Dynamic SQL
Error
SQL error code = -206
Column unknown
TIPO_IVA
Client SQL dialect 1 does not support reference to 64-bit numeric datatype
¿Someone can help me?
> SET SQL DIALECT 1;
This is for ISQL only. It won't work in an app.
I don't know if IC 1.6 supports dialect 3. It's *very* old. Check the
IC documentation for how to set your correct client dialect. You *may*
need a newer version of IC.
--
Craig Stuntz [TeamB] · Vertex Systems Corp. · Columbus, OH
Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
How to ask questions the smart way:
http://www.catb.org/~esr/faqs/smart-questions.html