Package com.openbravo.data.loader

Examples of com.openbravo.data.loader.BaseSentence


       
       
        SQLDatabase db = new SQLDatabase(AppLocal.APP_NAME + " - Database.");
       
        try {
            BaseSentence sent = new MetaSentence(m_App.getSession(), "getTables"
                    , new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING})
                    , new SerializerReadBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING}));
            DataResultSet rs = sent.openExec( new Object[] {null, null});         
            while (rs.next()) {
                Object[] aTable = (Object[]) rs.getCurrent();
                db.addTable((String) aTable[2]);
            }           
            rs.close();
            sent.closeExec();
           
            sent = new MetaSentence(m_App.getSession(), "getColumns"
                    , new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING})
                    , new SerializerReadBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING}));
            rs = sent.openExec(new Object[] {null, null, null});
            while (rs.next()) {
                Object[] aColumn = (Object[]) rs.getCurrent();
                SQLTable t = db.getTable((String) aColumn[2]);
                if (t != null) {
                    t.addColumn((String) aColumn[3]);
                }
            }           
            rs.close();
            sent.closeExec();
           
        } catch (BasicException e) {
            // e.printStackTrace();
        }       
      
View Full Code Here


                        " 'N'," +
                        " 0," +
                        " null)";
                System.out.println(i);
                System.out.println(sentence);
                BaseSentence sent = new StaticSentence(m_App.getSession(), sentence);
                sent.exec();
            }
        } catch (BasicException e) {
            e.printStackTrace();
        }       
    }
View Full Code Here

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // BaseSentence sent = new MetaSentence(m_App.getConnection(), "getTables", new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING}), null);
        // BaseSentence sent = new MetaSentence(m_App.getConnection(), "getColumns", new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING}), null);
        // executeSentence(sent, new Object[] {null, null, null});

        BaseSentence sent = new BatchSentenceScript(m_App.getSession(), m_jtxtSQL.getText());
        if (executeSentence(sent)) {
            // guardamos la historia.
            if (!m_aHistory.get(m_iHistoryIndex).equals(m_jtxtSQL.getText())) {
                m_iHistoryIndex ++;
                m_aHistory.subList(m_iHistoryIndex, m_aHistory.size()).clear();
View Full Code Here

       
       
        SQLDatabase db = new SQLDatabase(AppLocal.APP_NAME + " - Database.");
       
        try {
            BaseSentence sent = new MetaSentence(m_App.getSession(), "getTables"
                    , new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING})
                    , new SerializerReadBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING}));
            DataResultSet rs = sent.openExec( new Object[] {null, null});         
            while (rs.next()) {
                Object[] aTable = (Object[]) rs.getCurrent();
                db.addTable((String) aTable[2]);
            }           
            rs.close();
            sent.closeExec();
           
            sent = new MetaSentence(m_App.getSession(), "getColumns"
                    , new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING})
                    , new SerializerReadBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING, Datas.STRING}));
            rs = sent.openExec(new Object[] {null, null, null});
            while (rs.next()) {
                Object[] aColumn = (Object[]) rs.getCurrent();
                SQLTable t = db.getTable((String) aColumn[2]);
                if (t != null) {
                    t.addColumn((String) aColumn[3]);
                }
            }           
            rs.close();
            sent.closeExec();
           
        } catch (BasicException e) {
            // e.printStackTrace();
        }       
      
View Full Code Here

                        " 'N'," +
                        " 0," +
                        " null)";
                System.out.println(i);
                System.out.println(sentence);
                BaseSentence sent = new StaticSentence(m_App.getSession(), sentence);
                sent.exec();
            }
        } catch (BasicException e) {
            e.printStackTrace();
        }       
    }
View Full Code Here

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // BaseSentence sent = new MetaSentence(m_App.getConnection(), "getTables", new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING}), null);
        // BaseSentence sent = new MetaSentence(m_App.getConnection(), "getColumns", new SerializerWriteBasic(new Datas[] {Datas.STRING, Datas.STRING, Datas.STRING}), null);
        // executeSentence(sent, new Object[] {null, null, null});

        BaseSentence sent = new BatchSentenceScript(m_App.getSession(), m_jtxtSQL.getText());
        if (executeSentence(sent)) {
            // guardamos la historia.
            if (!m_aHistory.get(m_iHistoryIndex).equals(m_jtxtSQL.getText())) {
                m_iHistoryIndex ++;
                m_aHistory.subList(m_iHistoryIndex, m_aHistory.size()).clear();
View Full Code Here

TOP

Related Classes of com.openbravo.data.loader.BaseSentence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.