How can I get Data in String Array from TABLE

hi all
I have table in MS Access databse called Login with two coulmn (User, Password),
I want to get all the User Name in a string[] called USER,
(LIKE USER = {"AA","BB","CC",........"zz"};
i made somthing like this
public class User_Name
final String driver = Login_Dialog.T_driver.getSelectedItem().toString();
final String url = Login_Dialog.T_URL.getSelectedItem().toString();
final String user = Login_Dialog.T_User.getText().toString();
final String password = new String(Login_Dialog.T_Password.getPassword());
static Connection connection;
static Statement statement;
static String sql;
static ResultSet rs = null;
static String[] User ;
public String User_Name()
try
//Load Driver
Class.forName(driver);
// Make Connection
connection=DriverManager.getConnection(url,user,password);
// Create Statement
statement = connection.createStatement();
sql = "SELECT User FROM Login" ;
// Create Resultset
rs = statement.executeQuery(sql);
ResultSetMetaData MD = rs.getMetaData();
int C_N = MD.getColumnCount();
if(rs.next())
for(int i = 2 ; i<=C_N ; i++)
User = rs.getString(2);
statement.close();
rs.close();
connection.close();
return User;
catch(ClassNotFoundException cnfex) {
//show message
JOptionPane.showMessageDialog((Component) null,
"Failed to load driver..."+
"\n"+cnfex.getMessage(),
"Error...",
JOptionPane.ERROR_MESSAGE,
UserDatabase.Error_Icon);
catch(SQLException sqlex){
//show message
JOptionPane.showMessageDialog((Component) null,
"Unable to connect to Database..."+
"\n"+sqlex.getMessage(),
"Error...",
JOptionPane.ERROR_MESSAGE,
UserDatabase.Error_Icon);
but i can get any thing so plz anybody send me a code for this one or help me out
Thanx
Regards
Satinderjit

in for loop, try;
user[i] = rs.getString(2);

Similar Messages

  • How can I get data in flat file from Pool table and cluster table ?

    Hi,
    I am working in one Achiving project. My requirement is to get data into flat file from Cluster table and pool table.
    Is there any tool avilable to download data into flat file from pool table and cluster table ?
    if table name given in the selection screen then data will be downloaded into flat file.
    waiting for quick response.
    Best Regards,
    Bansidhar

    Data cannot be retrived directly form the cluster table
    as the Cluster results are stored in Cluster Key say for example PCLkey
    and form that Key we need to fetch the data
    these clustes are not the part of PNP or PNPCE tables
    for ur info kindly check

  • How can I get Data from the Sound cart in Labview? Does a VI exist?

    How can I get Data from the Sound cart in Labview? Does a VI exist?

    Yes, there are VIs for acquiring data from Sound cards. And examples too. If you don't have LabVIEW yet, do a search on NI's site for example VIs.
    Khalid

  • How can i get data from another database SQL Server use database link from

    I have a database link from Oracle connect to SQL Server database with user cdit connect default database NorthWind.How can I get data from another database(this database in this SQL Server use this database link)?

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • How can i get data from a maintance view?

    Hi all.
        Can you give me some suggestion about 'How can i get data from a maintance view?'?
         Thanks
         Best regard

    hi
    good
    go through this link
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/21ecdf446011d189700000e8322d00/content.htm
    thanks
    mrutyun^

  • How can i get getwayed url string using pluggable nav in news portlet?

    hi.
    How can i get getwayed url string using pluggable nav in news portlet?
    A code just like below is what I want.
    <param value="param=http://.../portal/server.pt/gateway/PTARGS_.../http/...">
    I tryed the following, but didn't work as I wanted.
    1.<param value="<pcs:valueexpr='var'/>">
    -> transformed. but I want the prefix 'param=' in the enquoted string's too.
    2. <param value="param=<pcs:valueexpr='var'/>">
    -> not transformed.
    Any idea?
    Hiroyuki

    Hi all,
    We have HPROF functionality in our latest roadmap, so you will see that feature in our next major release called JRockit R28.
    I recommend, above from the MemLeak documentation suggested by Makiey, the following information on how to use JRockit tools.
    Performance Tuning & Profiling:
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_02.html
    Using JRockit tools:
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_03.html
    Diagnostics & Troubleshooting
    http://download.oracle.com/docs/cd/E13150_01/jrockit_jvm/jrockit/geninfo/diagnos/part_04.html
    Best Regards,
    Tuva
    JRockit PM

  • How can I get in a String a text.... ?

    How can I get in a String a text in database,
    I tried =result.getString("fieldName") but don�t
    work.
    Tiago ticdd

    try this:
    String text = results.getString(columnIndex);
    or loop thru the ResultSetMetaData as follows:
    String text = results.getString(resultSetMetaData, columnName);
    function getColumnIndex(ResultSetMetaData rsmd, String columnName){
         int numCols = rsmd.getColumnCount();
         for (i=1; i <= numCols; i++){           
              if(rsmd.getColumnName(i).equalsIgnoreCase(columnName)){
                   return i;
         return -1;

  • How can we get the selected line number from JTextArea ?

    how can we get the selected line number from JTextArea ? and want to insert line/string given line number into JTextArea??? is it possible ?

    Praitheesh wrote:
    how can we get the selected line number from JTextArea ?
    textArea.getLineOfOffset(textArea.getCaretPosition());
    and want to insert line/string given line number into JTextArea??? is it possible ?
    int lineToInsertAt = 5; // Whatever you want.
    int offs = textArea.getLineStartOffset(lineToInsertAt);
    textArea.insert("Text to insert", offs);

  • How can i update data in okc_k_items and csi_item_instances tables?

    How can i update data in okc_k_items and csi_item_instances tables?
    by EBS .
    Thanks.

    For csi_item_instances table, you can use the following API:
    CSI_ITEM_INSTANCE_PUB.UPDATE_ITEM_INSTANCE
    For okc_k_items, try using the following API:
    OKC_CONTRACT_ITEM_PUB.UPDATE_CONTRACT_ITEM
    Hope this helps!

  • I have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    i have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to put everything back.
    If you have failed to bakup, then you can transfer itunes purchases from an ipod: File>Transfer Purchases

  • When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

  • My iPhone is stolen. How can I get my address book back from the iCloud? I should have synchronized my iPad address book. However, I loss some recent contacts from iPhone.

    My iPhone is stolen. How can I get my address book back from the iCloud? I should have synchronized my iPad address book. However, I loss some recent contacts from iPhone.

    I use my iPad to get the address book backed up by iCloud from my iPhone. However, I cannot see the recent new contacts from my iPad. Is there anyway to check the iCloud server to see if my address book backup from my iPhone is still there?

  • How can i get my i5 unlocked brought from Dubai(middle east), Now i want to use it in Pakistan(Asia)

    How can i get my i5 unlocked brought from Dubai(middle east), Now i want to use it in Pakistan(Asia).
    <Perosnal information removed by Host>

    As stated, only the original Cellular provider can unlock the phone. If they charge $250 for doing so, that is their decision. It is YOUR decision to pay that fee or not.

  • How can I get my Aperture library back from the Photos application?

    As stated above, How can I get my Aperture library back from the Photos application?  I'm not a fan of Photos right now and haven't used iPhoto in years, so that wasn't a loss... I didn't realize when I gave Photo's access to my Aperture library, I was going to lose it...
    I want to get it back, any suggestions?
    Thanks again!
    MacTeacherMN

    what means ..."Once you open the Aperture library back into Aperture..."? What do I need to "klick" in order to getting back my old Aperture Project structure....

  • How can I get help for ADE downloads from the public library.   I am suddenly getting error messages

    How can I get help for ADE downloads from the public library.  It worked for years and now I am getting error messages.   I cannot find any practical help

    If you are trying to open the book on a device, try using the latest DL Reader on Android and iOS
    https://play.google.com/store/apps/details?id=com.datalogics.dlreader&hl=en

Maybe you are looking for