Revision 13994

View differences:

branches/v10/extensions/extOracleSpatial/src/es/prodevelop/cit/gvsig/fmap/drivers/jdbc/oracle/OracleSpatialDriver.java
493 493
    private void loadSdoMetadata() {
494 494
        try {
495 495
            Statement _st = conn.createStatement();
496
            String qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
496
            String[] tokens = getTableName().split("\\u002E", 2);
497
            String qry;
498
            if (tokens.length > 1)
499
            {
500
            	qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
501
                " where OWNER = '" + tokens[0] + "' AND TABLE_NAME = '" + 
502
                tokens[1] + "'";
503
            }
504
            else
505
            {
506
            	qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
497 507
                " where TABLE_NAME = " + "'" + getTableName() + "'";
508

  
509
            }
510
//            String qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
511
//                " where TABLE_NAME = " + "'" + getTableName() + "'";
498 512
            ResultSet _rs = _st.executeQuery(qry);
499 513

  
500 514
            if (_rs.next()) {
......
3762 3776
        TreeMap ret = new TreeMap();
3763 3777

  
3764 3778
        while (rs.next()) {
3765
            ret.put(rs.getString("TABLE_NAME"), rs.getString("TABLE_NAME"));
3779
        	String nomCompleto = rs.getString("OWNER") + "." +rs.getString("TABLE_NAME");
3780
            ret.put(nomCompleto, nomCompleto);
3766 3781
        }
3767 3782

  
3768 3783
        return (String[]) ret.keySet().toArray(new String[0]);
......
3785 3800
            String sql = "(" + "(select TABLE_NAME from USER_TABLES) " +
3786 3801
                "union (select VIEW_NAME from USER_VIEWS)) " +
3787 3802
                "intersect (select TABLE_NAME from " + tablename + ")";
3788
            sql = "SELECT TABLE_NAME FROM " + tablename + "";
3803
            sql = "SELECT TABLE_NAME, OWNER FROM " + tablename + "";
3789 3804
            ResultSet rs = __st.executeQuery(sql);
3790 3805

  
3791 3806
            return rs;
......
3848 3863
    public String[] getGeometryFieldsCandidates(Connection conn,
3849 3864
        String table_name) throws SQLException {
3850 3865
        Statement _st = conn.createStatement();
3851
        String qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
3866
        String[] tokens = table_name.split("\\u002E", 2);
3867
        String qry;
3868
        if (tokens.length > 1)
3869
        {
3870
        	qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
3871
            " where OWNER = '" + tokens[0] + "' AND TABLE_NAME = '" + 
3872
            tokens[1] + "'";
3873
        }
3874
        else
3875
        {
3876
        	qry = "select * from " + ORACLE_GEOMETADATA_VIEW +
3852 3877
            " where TABLE_NAME = " + "'" + table_name + "'";
3878

  
3879
        }
3853 3880
        ResultSet _rs = _st.executeQuery(qry);
3854 3881

  
3855 3882
        ArrayList aux = new ArrayList();

Also available in: Unified diff