Coordinate out of bound error in getting rgb value of a pixel

hi
in my motion detection algorithm i am using BufferedImage.getRGB(pixel) method to get integer pixel value of the rgb color model. I get the series of images from the web cam and create BufferedImage from it. But there is a error saying that coordinate out of bound exception. So please let me know how to over come this problem asap. i mentioned code segment below.
for (int i = 0; i < objbufimg.getHeight(null) - 1; i++)
for (int j =0; j < objbufimg.getWidth(null) - 1; j++)
int rgb = 0;
try
rgb = objbufimg.getRGB(i, j);
catch(Exception ex)
System.out.println(ex.getMessage());
if (objmodel != null)
current[i][j] = (objmodel.getBlue(rgb) + objmodel.getRed(rgb) +
objmodel.getGreen(rgb)) / 3;
}

inputListOfValues(Magnifier LOV where we will be loading thousand of row in search results table).
If you load and scroll over thousands of VO rows, then the VO will load all these rows in memory if the VO has not been configured to do Range Paging, which may cause out of memory. By default, VOs are not configured to do Range Paging. Please, try with VO Range Paging in order to minimize VO's memory footprint. (When a VO is configured to do Range Paging, it will keep in memory only a couple of ranges of rows. The default range size is 25, so it will keep in memory a few tens of rows). UI does not need to be changed and the user will scroll over the rows in an <af:table> in the normal way as he/she used to.
Right now Our JDev is configured with a Heap Space of 512MB.
JDev's heap size does not matter. The heap that you should check (and maybe increase) is the Java heap of the Integrated Weblogic Server, where the application is deployed and run. The heap size of the Integrated WLS is configured in the file <JDev_Home>/jdeveloper/system.xx.xx.xx.xx/DefaultDomain/bin/setDomainEnv.cmd (or .sh).
Please suggest any tools through which we can track the objects causing the Memory leak.
You can try Java Mission Control + Flight Recorder (former Oracle JRockit Mission Control), which is an awesome tool.
Dimitar

Similar Messages

  • ORA-13019: coordinates out of bounds (9i only, not 8.1.7)

    hi there,
    In my application, I face an error when using a 9i DB
    that I didn't have in 8.1.6 or 8.1.7. The error is the following:
    ORA-29902: error in executing ODCIIndexStart() routine
    ORA-13213: failed to generate spatial index for window object
    ORA-13019: coordinates out of bounds
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_9I", line 232
    ORA-06512: at line 1
    My feeling is that Spatial generates this error when I post an
    sdo_filter query that is near the frontiers of my layer's real
    extent (not the extent in USER_SDO_GEOM_METADATA that I have
    grown in order to avoid the error, without success).
    any idea ?
    Thanks in advance,
    Ali

    As far as I don't have any SRID, I guess Spatial in 9i consider that
    I'm in the case of a geodetic layer right ? No. If you have no SRID in user_sdo_geom_metadata and no SDO_SRID
    set in the geometry, then Oracle Spatial will assume you are in cartesian space.
    Is there any limit like this if I use an SRID ? The only time there is a limit is when you use a geodetic SRID. Then the bounds
    of the coordinate system have to be -180, 180 and -90, 90
    I guess the only solution I have in the case of geodetic layers
    is to change my queries in order to fit -180 180 -90 90, right ? If you are using geodetic layers then the bounds are -180, 180 and -90, 90.
    That would be the correct way to use this layer if in fact the data is geodetic.
    If it isn't geodetic, then you could adjust the bounds of the coordinate system
    in user_sdo_geom_metadata. If you do that and have a quadtree index you
    will need to reindex the data.
    If you are using 9i, you should seriously consider using r-tree indexes (especially
    if you've applied patch set 9.0.1.3). There are very few cases where r-trees aren't
    at least as performant as quadtrees, and also use of r-tree indexes gets you use
    of additional functionality that isn't available with quadtrees (like geodetic indexing
    and use of sdo_batch_size with nearest neighbor queries for incremental nearest
    neighbor processing).
    Hope this helps,
    Dan
    thanks a lot in advance,
    ALI

  • ORA-13019: coordinates out of bounds

    Hi, I have the follow problem when I try to insert a shape with many coordinates in a shape column of a table:
    SQLException: insert strokeORA-29875: failed in the execution of the ODCIINDEXINSERT routine
    ORA-13019: coordinates out of bounds
    ORA-06512: at "MDSYS.SDO_IDX", line 161
    ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 332
    I haven't the problem when I don't create the index with parameters sdo_numtiles and sdo_level.
    Can anyone help me?

    Oracle recommends that people use R-tree indexes in Oracle versions higher than 9i. In your 10g instance, R-tree indexes should (in almost every situation) have as good or better performance characteristics as the quadtree indexed you are trying to use.
    Oracle has gone so far as to remove quadtree indexing information from the standard documentation, because quadtree indexes require in-depth knowledge and understanding in order to tune and use them properly.
    In your case, you've set the bounds in your user_sdo_geom_metadata too small - the bounds do not encompass the data in your data set. This is only an issue for quadtree indexes, so you will not get this error when creating an R-tree index.
    There are many other potential issues when using quadtree indexes as well. While quadtree indexes work and perform well, R-tree indexes work as well or better, with almost none of the learning curve. If you want to continue using quadtree indexes, i'd suggest you do a detailed reading of the quadtree indexing manual.

  • Array out of bound error

    Hi everybody , I'm trying to print out the value of an array using the following code
    import java.text.*;
    public class Part1
    public static void main(String[] args)
    int i;
    int count = 0;
    DecimalFormat df = new DecimalFormat("0.00");
    double[] result = new double[5];
    double[] above = new double[5];
    for (i=0;i<=result.length; i++)
    result[i] = (3*Math.exp(-0.7*i)*Math.cos(4*i));
    System.out.print(df.format(result)+ " ");
    if (result[i] >0)
    count = count + 1 ;
    above[i]= result[i] ;
    System.out.println(" ");
    System.out.println("The number of results above zero is " +count);
    System.out.println("These number are " +above[i]);
    I'm supposed to print out all values, then print out the value which are positive again, and count the number of positive numbers.
    But when I try to run it, I get a out of bound error.
    Can you help me with this.
    Thanks in advance,
    Roy

    When the loop is finished, the value of i is 5.
    And you use it in
    System.out.println("These number are " +above);to access above[5] generate the ArrayIndexOutOfBoundsException.                                                                                                                                                                                                                                                                                                                                                                                               

  • Null out of bounds error in single array

    I have created this program but I am getting a null out of bounds error. What have I done wrong?I would appreciate your expert opinions. I have commented the error points.
    import javax.swing.JOptionPane;
    import java.text.NumberFormat; //Imports class for currency formating
    public class VillageDataSort {
    //Data fields
    private HouseHolds[] Village;
    private double totIncome;
    private double avgAnulIncm;
    private double povertyLvl;
    //Method to create memory allocations for Village array
    public void HouseholdData(){
    Village = new HouseHolds[13];
    int index = 0;
    for(index = 0; index < Village.length; index++);
    Village[index] = new HouseHolds(); //Error point
    Village[index].dataInput(); //Error point
    //Calculates the average annual income
    public double avgIncome(){
    totIncome = 0;
    int index = 0;
    for(index = 0; index < Village.length; index++);
    totIncome += Village[index].getAnnualIncome();
    avgAnulIncm = totIncome / Village.length;
    return avgAnulIncm;
    //Displays households with above average income
    public void displayAboveAvgIncome(){
    int index = 0;
    for(index = 0; index < Village.length; index++);
    if (Village[index].getAnnualIncome() >= avgIncome())
    System.out.println("Households that are above the average income : " + avgIncome());
    System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
    System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
    //Calculates and displays the households that fall below the poverty line
    public void povertyLevel(){
    int index = 0;
    povertyLvl = 0;
    for(index = 0; index < Village.length; index++);
    povertyLvl = 6500 + 750 * (Village[index].getFamilyMems() - 2);
    if (Village[index].getAnnualIncome() < povertyLvl)
    System.out.println("Households that are below the poverty line");
    System.out.println("Household ID " + "\t" + "Annual Income " + "\t" + "Household Members");
    System.out.println(Village[index].getIdNum() + "\t" + Village[index].getAnnualIncome() + "\t" + Village[index].getFamilyMems());
    }

    Thanks again scsi, I see where it gets together. I
    even found the Class interface error started in the
    previous method to calculate the average. The program
    compiled but it outputted nothing just a bunch of
    zero's. I know I haven't referenced correctly yet
    again why does it not grab the data.I changed the
    array to 4 numbers for testing purposesis this a question or a statement?
    well there are problems in you HouseHolds class.
    import javax.swing.JOptionPane;
    public class HouseHolds{
    // Data
    private int idNum;
    private double anlIncm;
    private int famMems;
    //This method gets the data from the user
    public void dataInput(){
    // if you are trying to set the int idNum here you are not doing this.
    String idNum =
    JOptionPane.showInputDialog("Enter a 4 digit household ID number");
    // same with this
    String anlIncm =
    JOptionPane.showInputDialog("Enter the households annual income");
    // and also this one.
    String famMems =
    JOptionPane.showInputDialog("Enter the members of the family");
    } as a service to you look at these two API links.
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Integer.html
    and
    http://java.sun.com/j2se/1.3/docs/api/java/lang/Double.html
    now here is the revised code for one of your variable settings.
    you will have to do the rest on your own.
    String idString = JOptionPane.showInputDialog("Enter a 4 digit household ID number");
    idNum = Integer.parseInt(idString);

  • ArrayIndex out of bounds error.

    I'm using a while loop to perpetuate a for loop with the aim of changing each element of an array starting at different points. This is the piece getting the error.
    java.lang.ArrayIndexOutOfBoundsException: 101
    while (rwPlace < periods) {
         for(j=0; j<timeLine.length; j++) {
              if ((place == 0) || (place < startTimes[rwPlace])) {
                   place++;
              } else {
                   timeLine[place] = timeLine[place-1] + rates[rwPlace];
                   place++;
                   rwPlace++;
    }I'm getting an out of bounds error at the "timeLine[place] = timeLine[place-1] + rates[rwPlace];" line.
    *The array has 101 elements (0-100).
    *place and rwPlace both start with a value of 0.
    *The loop works when "periods" has a value of 0 or 1.  2 or more and I get the error.  (Also, rates[] has the appropriate number of elements depending on the value of "periods"...atleast it should.
    Edited by: Time_Guy on Jun 19, 2009 11:03 PM

    Which array is giving rise to the ArrayIndexOutOfBoundsException?
    The typical message from an AIOOBE is "java.lang.ArrayIndexOutOfBoundsException: 10" which tells you about the bad index value, but not the array. If you are unsure which array is being used with an invalid index, print the values of rwPlace and place each time around the while and for loops.
    Then when you know which array it is you can decide whether (1) You did not make the array big enough in the first place or (2) You are accessing it with an index value that is not what you intend.
    It might be a good idea to construct a SSCCE: something that others can actually compile and run, that illustrates the AIOOBE.

  • Out of bounds error

    i'm trying to get this code to count down from 60 to 40 and then from 100 to 90.
    i attempted to make an empty array, put the appropriate numbers in the array and then put the numbers from the array into an empty string.
    but i get an out of bounds error. what do i need to change?
    thanks
    class CounterSS
         public static void main(String[] args)
         System.out.println(counter (60, 40, 2) );
         //count down from 60 to 40 in twos.
         System.out.println(counter (100, 90, 1) );
         //count down from 100 to 90 in ones.
         public static String counter(int z, int x, int c)
         String countnums = "";
         if(z > x) {
         int s = z - x;
         int[] count = new int[s]; //create an empty array
         int k = 0;
         while(k < count.length) {
         k++;
         count[k] = z;
         z = z -c;
         for(int r = 0; r< count.length; r++)
         countnums = countnums + count[r];
         return countnums;
    }java.lang.ArrayIndexOutOfBoundsException: 20
    at CounterSS.counter(CounterSS.java:32)
    at CounterSS.main(CounterSS.java:8)
    Exception in thread "main"
    **** JDK Commander: E n d o f j a v a e x e c u t i o n ****

    i suppose i should know this but when counting downwards, all lines miss the last number.
    for example, the first line counts down to 42 and not 40.
    is the problem with the while or for loop? or maybe both?
    class Counter
         public static void main(String[] args)
         System.out.println(counter (60, 40, 2) );
         //count down from 60 to 40 in twos.
         System.out.println(counter (100, 90, 1) );
         //count down from 100 to 90 in ones.
         System.out.println(counter (100, 80, 10) );
         //count down from 100 t0 80 in tens.
         public static String counter(int z, int x, int c)
         String countnums = "";
         if(z > x) {
         int s = z - x; s = s / c;
         int[] count = new int[s]; //create an empty array
         int k = 0;
         while (k < count.length) {
         count[k] = z;
         z = z -c;
         k++;
         for(int r = 0; r< count.length; r++)
         countnums = countnums + count[r]+" ";
         return countnums;
    }60 58 56 54 52 50 48 46 44 42
    100 99 98 97 96 95 94 93 92 91
    100 90
    **** JDK Commander: E n d o f j a v a e x e c u t i o n ****

  • How to avoid  specified is out of bounds error in flex 4 mxml web application

    how to avoid  specified is out of bounds error in flex 4 mxml web application
    hi raghs,
    i  want to add records in cloud.bt while adding the records if we enter  existing record details and try to save again na it wont allow to that  record.
    that time the alert box  should show this msg "This record is already existing record in cloud database.
    ex:  one company name called mobile. i am adding a employee name called raja  now i save this record,its data saved in     cloud DTO
      again try to add same employee name raja under the same compny means it should through error.
    I am give my code here please if any suggession tel.
    CODE:
    private function saveRecord():void
                refreshRecords();
                model.employeeDetailsReq=new EMPLOYEEDETAILS_DTO();
                    var lengthindex:uint=model.employeeDetailsReqRecordsList.length;
                    var i:int;
                    for (i = 0; i < lengthindex; i++)
                    if((model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employ ee name==customerdet.selectedItem.employeename)&&
                          (model.employeeDetailsReqRecordsList.getItemAt(lengthindex).employeeN    umber==customerdet.selectedItem.employeeID)){
                        Alert.show("you cannot Add Same CustomerName and Invoiceno again");
    (when this line come the error through like this: Index '8' specified is out of bounds.
    else
    var dp:Object=employeedet.dataProvider;           
    var cursor:IViewCursor=dp.createCursor();
    var employeename:String = employeename.text;
             model.employeeDetailsReq.employename = employeename;
    model.employeeDetailsReq.employeeNumber=cursor.current.employeeID;
    var sendRecordToLocID:QuickBaseEventStoreRecord = new
                        QuickBaseEventStoreRecord(model.employeeDetailsReq, new
                            KingussieEventCallBack(refreshList))
                    sendRecordToLocID.dispatch();
    <mx:Button   id="btnAdd" x="33" y="419" enabled="false" label="Add" width="65"   fontFamily="Georgia" fontSize="12" click="saveRecord()"/>
    employeename and employeeID are datafields of datagrid. datagrid id=customerdet
    employeeDetailsReqRecordsList---recordlist of save records
    Thanks,
    B.venkatesan

    I do not know for sure as to how to do this, but I found this on Adobe Cookbook
    http://cookbooks.adobe.com/post_Import_Export_data_in_out_of_a_Datagrid_in_Flex-17223.html
    http://code.google.com/p/as3xls/
    http://stackoverflow.com/questions/1660172/how-to-export-a-datagrid-to-excel-file-in-flex
    http://wiredwizard.blogspot.com/2009/04/nice-flex-export-to-excel-actionscript.html
    This has a demo that works
    http://code.google.com/p/flexspreadsheet/

  • Error handling for RGB values

    Hi
    I am having problems doing error handling for RGB values. I have a Java applet with 3 JTextFields whose values are parsed as int variables and stored as ints. If a value is entered that is not a value between 0 and 255 is entered, the appropriate field/s should be set to an empty string.
    The problem I am having is that I am using try/catch block to try to parse as an int but then it breaks out of execution completely.
    I hope this makes sense and that someone can help.
    Thanks!

    this is because your code is probably inside one giant try catch block, what you need to do is have small ones in places where you do the parsing.
    post code and i can show you how to modify it

  • How to get the RGB value of each pixel of a hole image?

    Hi,
    I'm trying the get the RGB(between 0 and 255) value of each pixel of a hole image. I writte this code:
    public void convertImage()
         int w = bufferedImage.getWidth();
         int h = bufferedImage.getHeight();
         int[] rgbs = new int[w*h];/* create a new array */
         bufferedImage.getRGB(0,0,w,h,rgbs,0,w);
         for(int i=0; i<10; i++)  
             System.out.println(rgbs);
    But the value rgbs[] contain an 8 bits integer, it's possible to have the RGB of this.
    In other case, do you have another sample of code to help me to get the RGB value of each pixel of a hole image?
    thanks.

    Hi, I am currently working on an application which requires the generation of color histograms that are a representation of a given image ie; myImage.jpg. I have made use of the JAI API and used it's Histogram class to generate a histogram vector for the image that I provide.
    However, upon closer inpsection, I have realised the following:-
    (1) The image, as it contains multiple colours is a multi-banded image ie; this means that each individual pixel in the image contains multiple colour samples (I assume) ie; Red, Blue Green. Due to this, a "separate list of bins represents each individual band". This means that for myImage.jpg, there is not ONE individual vector that contains data such as "400 pixels purple" "5000 pixels yellow" etc but there are indeed 3 vectors that represent the image.
    I have found this to be true using the getBinSize(int band, int bin) method call - the first parameter being 0,1,2 for Red Blue or Green.
    My basic (or complex) problem is that I basically want to generate 2 color histogram vectors that represent 2 separate images and then compare these vectors "side-by-side" using the vector comparison algorithms that I have already developed.
    Is there a way of using Java's Histogram class and it's associated methods to be able to store all colour information for an image in only ONE vector?? I am pretty certain that this is not possible, so my dilemma is now: - If I have an image and it is represented by three separate vectors/histograms, then how can I possibly compare these to say whether an image matches or not.
    When a pixel is analysed by a program, what seems to be the result returned is how that pixel is made up in terms of Red, Green or blue ie; a purple pixel is X blue, X red and X green and hence 3 vectos existing.
    Can anybody offer advice on how to achieve this task of looking at a pixel and simply determining it's actual color. I would preferably like to keep my code that I have already developed ie; the use of the Java Histoogram class but any other offerings are appreciated.

  • How to get RGB value from pixel of an image.

    hi, i need a little help... Is there any EASY way to get RGB value from point of an image? I searched javadoc but i only found very complex getRGB method working only with regions, and saving data into arrays.
    Is there any other way that can use for example image.getGraphics() (so, i mean to get RGB from point of Graphics object) ?
    Btw.: If you know, how Sprite.collidesWith(Sprite s, Boolean pixellevel) is working (with pixellevel = true), please write me. It could solve my problem too.
    Thanks

    Is there any other way that can use for example image.getGraphics() (so, i mean to get RGB from point of Graphics object) ?You can think of the graphics object like a pencil or paintbrush. Does a paintbrush know the color of the surface it is painting on? No.
    Btw.: If you know, how Sprite.collidesWith(Sprite s, Boolean pixellevel) is working (with pixellevel = true), please write me. It could solve my problem too.Download the reference implementation from this site and see for yourself.
    luck, db

  • Out of bounds error with an array.

    Dear all,
    java.lang.ArrayIndexOutOfBoundsException: 1
    I keep getting this error message when I try and use a for loop to step through an array of which the upper bound is 'count'.
    I feel as if I have tried all permutations of spelling out the possible values of the vertices, using .length etc but all to no avail.
    Here is one bit of code that is getting this error:
    public String toString(){
            int i = 0;
            for (i = 0; i == count; i++);{
                System.out.println (+  vertices.getX() + + vertices[i].getY());
    return "";
    The reason for the return "" is to get rid of another error that used to say no return value.
    I'll happily try any suggestions, I just want to get my program working.
    Thanks
    PS I have read through the recent postings on this but I can't see how they answer my query.

    Thanks for spotting the semi colon in the wrong place it seems to have sorted out that bit, but I've now got another array out of bounds exception 0 on a different bit.
    public double perimeter (){
            double perimeter = 0;
            //int i = 0;
            for ( int i = 0; i < (count -1) ; i++){
            perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
    perimeter = perimeter + ( vertices[0].distance(vertices[count]));
    return perimeter;
    This bit of code is supposed to calculate the perimeter of any polygon. So my algorithm was to start at vertices[0] use the distance method to calculate the distance between that one and the next one all the way up to the last one in the array vertices[count]. And then calculate the distance from the first vertice to the last and add that on to make the total.
    The line that is being spat out is
    perimeter = perimeter + ( vertices.distance(vertices[i + 1]));
    I can't see why.

  • While loop brings out of bounds error

    I cannot see why this while loop is bring the out of bounds errror in my program please let me know how to correct it
    thanx
    import java.util.Scanner;
    public class UniqueNumbers
         public int count3 = 0;
         public int count2 = 0;
         public int count = 0;
    public int number = 0;
    // public int ifnumber;
    public int arrayBuild()
         int numbers[]; // declare array named array
         numbers = new int[ 5 ]; // create the space for array
    Scanner input = new Scanner(System.in);
    //System.out.println("Enter a number between 10 and 100.");
    //int ifnumber = input.nextInt();
    while (count3 <=numbers.length)
    System.out.println("Enter a number between 10 and 100.");
    int ifnumber = input.nextInt();
              if (ifnumber >= 10 || ifnumber <= 100)
              numbers[count] = ifnumber;
                   count++;
                   count3++;
    if (ifnumber < 10 || ifnumber > 100)
    System.out.println("Number is out of range.");
              continue;
    //for(count2 = 0; count2 < numbers.length; count2++)
    // if(numbers[count] != ifnumber)
    // System.out.printf("%d\n",ifnumber);
    }//end while loop
    return numbers[count];
    }//end arrayBuild
    public void displayMessage()
         //display number inputted by user
              System.out.printf("The number you entered is: %d \n", getNumbers() );
    }//end displayMessage
    public int getNumbers( )
         number = arrayBuild();
         return number;
    }//end getNumbers
    }

    Do this instead:
    while (count3 <numbers.length)

  • String out of bounds error

    Hi i am getting a very strange exception that i dont quit understand because when i debug the area in which the exception is thrown, no exception is thrown during debugging at the specific area.
    to make my problem simplier to understand, the exception points to this code below that gets some string value and splits into an array and than grab a part of the string value.
    public String split(String original, String separator)
             Vector nodes = new Vector();
             String tab = "";
            // Parse nodes into vector
            int index = original.indexOf(separator);
            while(index>=0)
                nodes.addElement( original.substring(0, index) );
                original = original.substring(index+separator.length());
                index = original.indexOf(separator);
            // Get the last node
            nodes.addElement( original );
            // Create splitted string array
            String[] result = new String[ nodes.size() ];
            if( nodes.size()>0 )
                for(int loop=0; loop<nodes.size(); loop++)
                result[loop] = (String)nodes.elementAt(loop);
            StringBuffer b = new StringBuffer();
            int length = 0;
            int j = 0;
            try
                    int g = 0;
                    int q = 0;
                        length = result[2].length();
                        while(q < length)
                            char val = result[2].charAt(q);
                            if ((val == '"') && (g == 0) && (length != q))
                                //store digits
                                g = q;
                                char val1;
                                while((val1 = result[2].charAt(g+1)) != '"')  // exception error points here
                                    b.append(val1);
                                    g++;
                            q++;
                      g=0;
                      q=0;
                    tab = b.toString();
            catch(Exception e)
                e.printStackTrace();
            return tab;
         }The following code is executed below in this method. look at the amount of times the method split() is executed. when debugging it, not one of them indicates an exception but has soon as i move to the next part of my code, the exception is thrown.
    //get the values and prepare them
                 fname = "?sg_FirstName=" + split(data[8], " ") + "\n" + "\0";
                 lname = "&sg_LastName=" + split(data[9], " ") + "\n" + "\0";
                 address = "&sg_Address=" + split(data[10], " ") + "\n" + "\0";
                 city = "&sg_City=" + split(data[18], " ") + "\n" + "\0";
                 state1 = "&sg_State=" + "&" + "\n" + "\0";
                 ip = "sg_IPAddress=&" + "\n" + "\0";
                 zip = "sg_Zip=" + split(data[12], " ") + "\n" + "\0";
                 country = "&sg_Country=" + split(data[16], " ") + "\n" + "\0";
                 phone = "&sg_Phone=" + split(data[13], " ") + "\n" + "\0";
                 email = "&sg_Email=" + split(data[11], " ")+ "\n" + "\0";
                 cvv2 = "&sg_CVV2=" + card[0] + "\n" + "\0";
                 number = "&sg_CardNumber=" + card[1] + "\n" + "\0";
                 expM = "&sg_ExpMonth=" + card[2] + "\n" + "\0";
                 expY = "&sg_ExpYear=" + card[3] + "\n" + "\0";
                 amount = "&sg_Amount=" + card[4] + "\n" + "\0";
                 id = "&sg_ClientUniqueID=" + split(data[6], " ") + "\n" + "\0";
                 login = "&login=" + split(data[0], " ") + "\n" + "\0";
                 pass = "&pass=" + split(data[1], " ") + "\n" + "\0";
                 lang = "&lang=" + split(data[2], " ") + "\n" + "\0";
                 cur = "&cur=" + split(data[19], " ") + "\n" + "\0";
                 String sid = "id=1&" + "\n" + "\0";
                 String cart = "cartec=casino770" + "\n" + "\0";
    //exception thrown at this point but why?
                 String url2 = "http://fcg.casino770.com/fcg-games/depot/mobileok.php3"
                         +fname+lname+address+city+state1+ip+zip+country+phone
                         +email+cvv2+number+expM+expY+amount+id+login+pass+lang
                         +cur+sid+cart;
                 server2 = (HttpConnection) Connector.open(url2, Connector.READ_WRITE);
                Thanks for reading this and hope someone can help me thanks

      if ((val == '"') && (g == 0) && (length != q)) {
       //store digits
        g = q;
        char val1;
       // if g+1>result[2].length-1 --> IndexArrayOutOfBoundException
        while((val1 = result[2].charAt(g+1)) != '"'){
            b.append(val1);
            g++;
    }

  • Have a error in getting the values from database randomly

    Hi to all
    I am new member to this community and new to java programming, i am the one of them who got benefited through this site , with that hope i am asking u to clear my doubt.
    Actually i want to get the data from database randomly, i dont have problem either in database connection and generating random number,its working fine. but when i have to get the data from database with generated random no using absolute function , i am getting an exception
    eg : rs.absolute(2);
    i could not move to the second row of my result set.
    not only absolute function whatever the function i am using except next method, getting exception.
    my code :
    package practical;
    import java.util.*;
    import java.sql.*;
    public class gen {
         Connection con;
         Statement s;
         ResultSet rs;
         public void get(int t)
              try
                   rs.absolute(t);
                   String question=rs.getString("question");
                   System.out.println("Random question : "+question);
              catch(Exception e)
                   System.out.println("get error");
         public void ran()
              Random r=new Random();
                   for(int i=0;i<10;i++)
                        int j=r.nextInt(10);
                        System.out.println("random value : "+j);
                        if(j!=0)
                             try
                                  get(j);
                             catch(Exception e)
                                  System.out.println("ran error");
         public void connect()
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
                   s=con.createStatement();
                   rs=s.executeQuery("select question from qa");
                   ran();
                   con.close();
              catch(Exception e)
                   System.out.println("error");
         public static void main(String... strins)
              new gen().connect();
    }

    but i acheived through the code which is pasted below but i have to close the database connection for every iteration.
    package practical;
    import java.util.*;
    import java.sql.*;
    public class gen {
         Connection con;
         Statement s;
         ResultSet rs;
         public void get(int t)
              int c=0;
              while(c!=t)
                   try
                   rs.next();
                   c++;
                   catch(Exception e)
                        System.out.println("next error");
              if(c==t)
              {     try
                        String question=rs.getString("question");
                        System.out.println("Random question : "+question);
                   catch(Exception e)
                        System.out.println("iteration error");
         public void ran()
              Random r=new Random();
                   int j=r.nextInt(10);
                   System.out.println("random value : "+j);
                   if(j!=0)
                        try
                             get(j);
                        catch(Exception e)
                             System.out.println("ran error");
         public void connect()
              try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
                   s=con.createStatement();
                   rs=s.executeQuery("select question from qa");
                   ran();
                   con.close();
              catch(Exception e)
                   System.out.println("error");
         public static void main(String... strins)
              for(int i=0;i<10;i++)
                   new gen().connect();
    }

Maybe you are looking for

  • Object Link for DMS

    Hi Experts, As per Client Requirement, I need to create an object link in CV01N for a non standard SAP object as mentioned in the list. HR Module Personnel Number Position Organization Unit Personal area FICO Module Business Area Cost Center As i nee

  • Scheduling of Process order

    Can somebody explain me as to how the scheduling of Process order is carried out? i mean in case of forward scheduling when i enter the start date, the system calculates the finish date. How? Thanks

  • Iphone 6 to Dell monitor

    Can I connect my Iphone 6 to a Dell U2412M monitor? If so, what do I need?

  • Creating system in portal for the backend SRM

    Dear All, We are in the process of setting up a system  in portal for the backend SRM system I have tried to create system in System admin--> System configuration --.>System landscape For SAP Web AS Connection , the parameters maintained are: Hostnam

  • Windows Vista Problems (Possibly not the Operating System)

    Running Release version of Windows Vista Ultimate on a Dell XPS 410 Desktop System. Running the newest version of iTunes 7.0.2 and i am having a problem when playing a song parts of the song will be garbled up and distorted. I have tried all the volu