Home » Developer & Programmer » Forms » How to read java arraylist in pl/sql ? (windows 7, oracle11g forms )
How to read java arraylist in pl/sql ? [message #591443] Sun, 28 July 2013 23:25 Go to next message
s1984
Messages: 5
Registered: May 2012
Location: chennai
Junior Member
Hi All,
I have created below program to read data from text file and stores in ArrayList. I want to read that arrylist
return matches;
in Oracle forms 11g.
Glad if you could help me on this.

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;


public class getLegends  {

    public static void main(String[] args) {
    	getLegends  fileReaderService = new getLegends ();
        fileReaderService.performExecute("RD_RM_TIME_TBL");
    }

    public  List<String[]> performExecute(String inputPattern) {
        List<String[]> matches = new ArrayList<String[]>();
        try {
            FileInputStream fileInputStream = new FileInputStream("./getLabel/data.txt"); /*change your file path here*/
            DataInputStream dataInputStream = new DataInputStream(fileInputStream);
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(dataInputStream));
            String strLine;
            
            while ((strLine = bufferedReader.readLine()) != null) {
                if (strLine.contains(inputPattern)) {
                    String[] splits = strLine.split("\\s*,\\s*");
                    matches.add(splits);
                }
            }
            dataInputStream.close();

            for (String[] items : matches) {
                System.out.println(items[0] + "\t" +items[1] + "\t" + items[2] + "\t" + items[3] + "\t" + items[4]);
            }
            
            

        } catch (Exception e) {
            e.printStackTrace();
        }
		return matches;

    }
}

I have created a jar file and imported into forms.

[Updated on: Sun, 28 July 2013 23:26]

Report message to a moderator

Re: How to read java arraylist in pl/sql ? [message #660238 is a reply to message #591443] Mon, 13 February 2017 05:05 Go to previous messageGo to next message
antoniosarco
Messages: 2
Registered: February 2017
Junior Member
Check this one to know more about....ArrayList Operations

Anto
Re: How to read java arraylist in pl/sql ? [message #660251 is a reply to message #660238] Mon, 13 February 2017 08:08 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
You do realize this question was asked 4 years ago, right?
Previous Topic: Meassge sending termwise
Next Topic: Use own Menu, but keep default menu
Goto Forum:
  


Current Time: Thu Mar 28 07:56:08 CDT 2024