how to get random records from msaccess table connected to java applet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neelesh kumar
    New Member
    • Mar 2007
    • 44

    how to get random records from msaccess table connected to java applet

    sir,
    i have a java applet j2sdk1.4.1_01 .i am using msaccess database .
    Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") .
    in my program i want to get records from access table in a new frame randomly(random records).In my frame i have next button now if i click next button, next record is coming from the table.
    i want to get random records from the table and come on the frame one by one when i click next button.
    how to write code in java.
    please help me.
    thanks in advance.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by neelesh kumar
    sir,
    i have a java applet j2sdk1.4.1_01 .i am using msaccess database .
    Class.forName(" sun.jdbc.odbc.J dbcOdbcDriver") .
    in my program i want to get records from access table in a new frame randomly(random records).In my frame i have next button now if i click next button, next record is coming from the table.
    i want to get random records from the table and come on the frame one by one when i click next button.
    how to write code in java.
    please help me.
    thanks in advance.
    First determine the number of rows(results) you have say n. Then generate a random number (r) between 1 and n. You then call resultest.next( ) r times before displaying the result.

    Comment

    • neelesh kumar
      New Member
      • Mar 2007
      • 44

      #3
      sir,
      please give the code.i didnt get random records from the table.please give code.
      Thanks in advance

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by neelesh kumar
        sir,
        please give the code.i didnt get random records from the table.please give code.
        Thanks in advance
        Which part did you get stuck on?

        Comment

        Working...