0

I have a table in a DB, I need to create a dbf file in groovy. I am using sql.call and ResultSet to get data from a table. How can I generate a dbf file?

OutParameter CURSOR_R = new OutParameter() {
    public int getType() {
        return OracleTypes.CURSOR;
    }
}

def execute(Connection conn, String a, String b, String c, String d) {

    Sql sql = new Sql(conn)
    def ct = sql.firstRow("select max(cl_type) r from PRT.st c where a_id= ?", [a])
    Integer type = ct.r
    if (type==1){

        sql.call("{?=call  PRT.PKG_LT_ALL.cgt (a => ?, b => ?, c => ?, d => ?)}"
                , [CURSOR_R,
                   a,
                   b,
                   c,
                   d
        ]) {
            //ResultSet row_service -> reader.readResultSet(row_service)
        }
    }
}
Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95
Ekz0
  • 63
  • 1
  • 8
  • Please add also the code where you deal with the DBF creation and what errors you get (e.g. stacktraces, logs, ...) so we can improve on it. – cfrick Nov 30 '20 at 09:41
  • The problem is that I don't know how to implement this. I did not find examples on the Internet. – Ekz0 Nov 30 '20 at 11:56
  • https://stackoverflow.com/questions/8064937/what-is-the-best-opensource-dbf-driver-for-java – daggett Nov 30 '20 at 18:12
  • I read the answer that was voted for by 16 people but didn't figure out how to save the dbf file? And did I understand correctly that the dbf is formed from the request using the ResultSet? Please look at it in a separate question: https://stackoverflow.com/questions/65097720/how-to-save-a-dbf-file-in-groovy-or-java – Ekz0 Dec 01 '20 at 20:04

0 Answers0