[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - SQLBase (GUPTA) - getIndexInfo(...) => SQLException

olvin do-not-reply at jboss.com
Mon Jul 24 09:10:46 EDT 2006


Hello,

We try to access to a SQLBase database from Gupta and there's only one problem remaining...
We have the last JDBC Driver from Gupta (v. 9.0.1)
We try to deploy the example "cmproster" from the ejb directory from j2eetutorial1.4 from Sun :
- With HyperSonic SQL => no problem.
- with SQLBase => I can see the connection created in the Databases Manager but we have the following SQLException generated by the JDBC Driver : "Only approximate statistics are supported.!"

After a short analyse, the exception is generated by the getIndexInfo method from the JDBC Driver. Here's the decompiled method :
    public ResultSet getIndexInfo(String s, String s1, String s2, boolean flag, boolean flag1)
        throws SQLException
    {
        String s3 = null;
        if(s != null)
            getIndexInfoCatalog = null;
        else
            getIndexInfoCatalog = "%";
        if(s1 != null)
            getIndexInfoSchema = s1.toUpperCase();
        else
            getIndexInfoSchema = "%";
        if(!flag1)
            throw new SQLException("Only approximate statistics are supported.!");
        getIndexInfoTable = s2.toUpperCase();
        prepareQuery("Select null as TBALE_CAT, Tbcreator as TABLE_SCHEM, Tbname as TABLE_NAME, @Decode(Uniquerule,'D','True','False') as NON_UNIQUE, Ix.Creator as INDEX_QUALIFIER, Ix.Name as INDEX_NAME, @Decode(Ixtype, 'H', 2, 'B', 1, 0) as TYPE, Ky.Colseq as ORDINAL_POSITION, Ky.Colname as COLUMN_NAME, Ky.Ordering as ASC_OR_DESC, Ky.Distinctcount as CARDINALITY, Indexpagecount as PAGES, null as FILTER_CONDITION From Sysadm.Sysindexes Ix, Sysadm.Systables Tb, Sysadm.Syskeys Ky Where (Tbcreator = Tb.Creator) And (Tbname = Tb.Name)       And (Ix.Name = Ky.IxName) And TBCreator like ? And (Tbname = ?)       And (Uniquerule = ?) ");
        ps.setString(1, getIndexInfoSchema);
        ps.setString(2, getIndexInfoTable);
        if(flag)
            s3 = "U";
        else
            s3 = "D";
        ps.setString(3, s3);
        rs = ps.executeQuery();
        return rs;
    }


And the getIndexInfo method is called from "org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.getOldIndexes" :
14:29:06,093 WARN  [ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=team-ejb.jar
	org.jboss.deployment.DeploymentException: Error while geting column names; - nested throwable: (java.sql.SQLException: Only approximate statistics are supported.!)
        at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.getOldIndexes(SQLUtil.java:1168)
        at org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.execute(JDBCStartCommand.java:215)

All that I have found is that (for another JDBC driver) :
http://mail-archive.objectweb.org/c-jdbc/2005-02/msg00066.html

You can see that the getIndexInfo method is called with false as the last parameter...

So, here's my question :
Someone could give me a way to configure JBoss (or the ejb) correctly to avoid the call of the method with false as the last parameter to avoid the SQLException returned from JDBC Driver ?

Thanks,

Olivier[/url]

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3960355#3960355

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3960355



More information about the jboss-user mailing list