On 13.01.2013 14:20, Massimo Re wrote:
> I'm writing you again becase i've updated squirrel to last version 3.4
> but when i write : SELECT * FROM MYTABLE WHERE and then i press
> CTRL+SPACE to see columns name they don't appear and a strange list of
> names appears (see attached document).
>
> This problem happen on this type of db :
>
> - SQLSERVER 2008
>
> - DB2 ISeries
>
I cannot reproduce this problem. But because this is the second time I
hear about problems with code completion I wrote a little piece of Java
code that tests out the retrieval of column information. I hope you are
a little acquainted with Java basics.
If so I' like you to adjust the code below to your needs and to let me
know what the results are.
Thanks in advance
Gerd
///////////////////////////
//
package pack;
import java.sql.*;
public class ColTest
{
public static void main(String[] args) throws
ClassNotFoundException, SQLException
{
// Note the driver must be in your classpath
Class.forName("<The driver name used in SQuirreL>");
Connection con =
DriverManager.getConnection(
"<The JDBC-URL used in SQuirreL>",
"<The user name used in SQuirreL>",
"<The user name used in SQuirreL>");
con.setCatalog("<The catalog or comment this line>");
DatabaseMetaData metaData = con.getMetaData();
ResultSet res = metaData.getColumns(
"<your schema name or null>",
"<your schema name or null>",
"<your table name>", "% or null");
while(res.next())
{
System.out.println("By index " + res.getString(4));
System.out.println("By name " + res.getString("COLUMN_NAME"));
}
}
}
//
/////////////////////////////////
|