Plz help using ms access as database,i want to create a login page in java

hye frnz... plz help me m new to java
m using ms access as database and try to create a login page where user type username and pw
i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
now there is an error class not found exception sun:jdbc...... error
plz help me i had stuck frm 4 days */
import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.Statement;
import java.sql.ResultSet;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Login extends JFrame
//Component Declarations
JLabel jlb1,jlb2;
     JTextField jtf1;
     JPasswordField jpf1;
     JButton jb1,jb2;
     //Constructor
     Login()
     //frame settings
          setTitle("Login Dialog");
          setLayout(new GridBagLayout());
          GridBagConstraints gbc = new GridBagConstraints();
          setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
          Dimension d= Toolkit.getDefaultToolkit().getScreenSize();
          setBounds(d.width/2-175,d.height/2-100,350,200);
          gbc.insets=new Insets(7,7,7,7);
     //adding components
          jlb1=new JLabel("User ID");
          gbc.gridx=0;
          gbc.gridy=0;
          add(jlb1,gbc);
          jlb2=new JLabel("Password");
          gbc.gridx=0;
          gbc.gridy=1;
          add(jlb2,gbc);
          jtf1=new JTextField(10);
          gbc.gridx=1;
          gbc.gridy=0;
          add(jtf1,gbc);
          jpf1=new JPasswordField(10);
          gbc.gridx=1;
          gbc.gridy=1;
          add(jpf1,gbc);
          jb1=new JButton("Login");
          gbc.gridx=0;
          gbc.gridy=2;
          add(jb1,gbc);
          jb1.addActionListener(new ActionListener()
               public void actionPerformed(ActionEvent ae)
               Connection conn=null;
                    Statement stmt=null;
                    boolean found=false;
               try
                         Class.forName("sun.jdbc.driver.JdbcOdbcDriver");
                         String dataSourceName = "Inventory";
                         String dbURL = "jdbc:odbc:" + dataSourceName;
                         conn=DriverManager.getConnection(dbURL, "","");
                         stmt=conn.createStatement();
                         ResultSet rst=stmt.executeQuery("Select * from User");
                         System.out.println(jtf1.getText()+"/t"+jpf1.getPassword());
                         while(rst.next())
                              System.out.println( rst.getString(1) +"/t"+ rst.getString(2));
          if(jtf1.getText().equals(rst.getString(1).trim()) && new String(jpf1.getPassword()).equals(rst.getString(2).trim()))
                                   found=true;
                                   rst.close();
                                   dispose();
                                   MainWindow mw= new MainWindow();     /*created min window object created to be opend after login but not working*/     
                                   break;
                         rst.close();
                         stmt.close();
                         conn.close();                    
                    catch(ClassNotFoundException e){System.out.print(e);}
                    catch(Exception e){System.out.print(e);}
                    if(found==false) /*this portion is executing and dialog box appears invalid name and pw with class not found exception sun:jdbc.......on console */
                         JOptionPane.showMessageDialog(null,"Invalid username or password",
                              "Error Message",JOptionPane.ERROR_MESSAGE);
          jb2=new JButton("Clear");
          gbc.gridx=1;
          gbc.gridy=2;
          add(jb2,gbc);
          jb2.addActionListener(new ActionListener()
               public void actionPerformed(ActionEvent ae)
                    jtf1.setText("");
                    jpf1.setText("");
                    jtf1.requestFocus();
          setSize(350,200);
          setVisible(true);
          jtf1.requestFocus();
     public static void main(String args[])
Login l=new Login();
Edited by: 795772 on Sep 19, 2010 4:44 AM

795772 wrote:
hye frnz... plz help me m new to java
m using ms access as database and try to create a login page where user type username and pw
i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
now there is an error class not found exception sun:jdbc...... error
plz help me i had stuck frm 4 days */
<snip>The subject of this forum is Oracle databases. How does your problem relate to that subject?
Two bits of advice:
1) Make sure you ask questions in a forum related to your problem.
2) If you want to be taken seriously as a professional, drop the MS IM Speak and use the language of the forum. In this forum it is English, which is successfully used by many people for whom English is far from their native language.

Similar Messages

  • I m using ms access as database and i want to create a login page in java

    hye frnz... plz help me m new to java
    m using ms access as database and try to create a login page where user type username and pw
    i had enter valid user entries in database i checked connectivity is working i want as user login the main window must open after checking username and pw field to database but
    now there is an error class not found exception sun:jdbc...... error
    plz help me i had stuck frm 4 days */
    import java.sql.DriverManager;
    import java.sql.Connection;
    import java.sql.Statement;
    import java.sql.ResultSet;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Login extends JFrame
    //Component Declarations
    JLabel jlb1,jlb2;
         JTextField jtf1;
         JPasswordField jpf1;
         JButton jb1,jb2;
         //Constructor
         Login()
         //frame settings
              setTitle("Login Dialog");
              setLayout(new GridBagLayout());
              GridBagConstraints gbc = new GridBagConstraints();
              setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
              Dimension d= Toolkit.getDefaultToolkit().getScreenSize();
              setBounds(d.width/2-175,d.height/2-100,350,200);
              gbc.insets=new Insets(7,7,7,7);
         //adding components
              jlb1=new JLabel("User ID");
              gbc.gridx=0;
              gbc.gridy=0;
              add(jlb1,gbc);
              jlb2=new JLabel("Password");
              gbc.gridx=0;
              gbc.gridy=1;
              add(jlb2,gbc);
              jtf1=new JTextField(10);
              gbc.gridx=1;
              gbc.gridy=0;
              add(jtf1,gbc);
              jpf1=new JPasswordField(10);
              gbc.gridx=1;
              gbc.gridy=1;
              add(jpf1,gbc);
              jb1=new JButton("Login");
              gbc.gridx=0;
              gbc.gridy=2;
              add(jb1,gbc);
              jb1.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                   Connection conn=null;
                        Statement stmt=null;
                        boolean found=false;
                   try
                             Class.forName("sun.jdbc.driver.JdbcOdbcDriver");
                             String dataSourceName = "Inventory";
                             String dbURL = "jdbc:odbc:" + dataSourceName;
                             conn=DriverManager.getConnection(dbURL, "","");
                             stmt=conn.createStatement();
                             ResultSet rst=stmt.executeQuery("Select * from User");
                             System.out.println(jtf1.getText()+"/t"+jpf1.getPassword());
                             while(rst.next())
                                  System.out.println( rst.getString(1) +"/t"+ rst.getString(2));
              if(jtf1.getText().equals(rst.getString(1).trim()) && new String(jpf1.getPassword()).equals(rst.getString(2).trim()))
                                       found=true;
                                       rst.close();
                                       dispose();
                                       MainWindow mw= new MainWindow();     /*created min window object created to be opend after login but not working*/     
                                       break;
                             rst.close();
                             stmt.close();
                             conn.close();                    
                        catch(ClassNotFoundException e){System.out.print(e);}
                        catch(Exception e){System.out.print(e);}
                        if(found==false) /*this portion is executing and dialog box appears invalid name and pw with class not found exception sun:jdbc.......on console */
                             JOptionPane.showMessageDialog(null,"Invalid username or password",
                                  "Error Message",JOptionPane.ERROR_MESSAGE);
              jb2=new JButton("Clear");
              gbc.gridx=1;
              gbc.gridy=2;
              add(jb2,gbc);
              jb2.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        jtf1.setText("");
                        jpf1.setText("");
                        jtf1.requestFocus();
              setSize(350,200);
              setVisible(true);
              jtf1.requestFocus();
         public static void main(String args[])
    Login l=new Login();
    }

    http://forums.oracle.com/forums/ann.jspa?annID=599
    Oh, and by the way, your keyboard seems to be broken as your words are not getting spelled correctly.

  • How do you create a login page using dashcode for the iPhone's mobile safari that will transfer you to the next page?

         Hey I have created a login page in Dashcode for a mobile safari app (aka iphone web app) and I am having trouble since I can not find any useful info about multiple pages. I don't want to use a stack layout view because it is only a login page and I need to check with a database to make sure the user's login info is correct. Right now I have it set up so that it loads another iphone web app project once it validates the info.
         The only problem with this is I am having a good bit of trouble trying to pass values from my php code to javascript or html. For some reason calling the javascript inside the php code makes the actual code inside the app not be called and same with the echo statment for the html.
    So I would like to be able to create the app in this way:
    Login page > PHP > MS SQL > PHP > UNKNOWN (if I can't get the javascript or html to output both) > Secure info on the next page
         I believe It would be a lot easier if I had the option for a multiple page but instead I am having to load up an entirely new dashcode project. If anyone knows a better way please let me know. Or if anyone knows a link to good information on passing values from php to javascript, because I couldn't get any of the code I tried to work, I would really appreciate it.

    Addendum to previous reply:
    OK.  This is weird--but I should be used to that, and just grateful that it seems to work (for now).
    What I had done is FTPd some image files to my site using Filezilla, but when I had tried to access them, I was unsuccessful.  I am almost sure that I used the same url (and variations of it) as you suggested, namely,  http://mysite.verizon.net/username/filename , and it either did not work, or gave me the "Page under construction", or, in some cases asked me for my username and password.
    But, when I did it this time, it worked.  So I probably had something off, but I can now do what I want.
    By the way, if you'll permit another question, while on the site-builder site, it said that there was a "Web Photo Manager", and said that "To download the Web Photo Manager: Open the Site Builder application and go to the All My Sites page. Click on the Web Photo Manager link (listed under Advanced Building Tools )."  I can't find it--would you happen to know where it is?
    In any case, thanks a lot for all your help--it solved my problem. 

  • Create a login page that does not link to database

    Hi,
    I am really new to muse and would like to seek some help....sorry if any similar questions have been asked.
    I am making a website interface for my assignment, and i need to create a login page,
    how can i make a text box for entering the login ID and the password? and how can i add a login button?
    By the way, this does not have to link to a database, it is just  a template........so the solution using codes may not help i guess

    Hi,
    check this thread Re: Can I create a login/password protection in Muse for a HTML5 page or two?

  • What front-end tools could be used to access the database server.

    Could someone please let me know what would be the role of a oracle DBA in the following fields of corporate sector and what might be the front-end tools used to access the oracle database. Any little help is very much appreciated. Thank you in advance.
    1. Telecommunication - Oracle 9i - Small to Medium size company
    2. Cash n Carry (with 4 to 5 branches) - Oracle 8i - small to medium
    3. Share broking (with two branches) - Oracle 8i - small

    The role of a DBA should be to get out as quickly as possible, because both 8i and 9i are desupported.
    Front-end tools are
    Developer
    JDeveloper
    HTML DB (probably no longer available, while desupported)
    Oracle Portal (9i and higher)
    .NET
    Oracle Application Express (successor of HTML DB, don't remember the minimum DB version, likely 10g)
    Sybrand Bakker
    Senior Oracle DBA

  • Using MS Access as Database from Remote Machine

    Hi All
    I am trying to use MS access as Data base, I have done the following.
    1. I have Added the mdb file on a remote machines DSN.(Control Panel->Admin Tools->ODBC->System Tools)
    2. In xMII data services->Data Servers, Copied the Default IDBC Server, renamed it and updated the ServerURL as  jdbc:inetdae:<IP of Remote machine>:1433?database=<DB Name>&sql7=true.
    With these things done, I am not able to get the Data Server Accesible.
    Please correct what mistake I have made.
    Thanks and Regards
    Rupesh

    Rupesh,
    First Access is not a very good database... I would suggest using MSSQL, MySQL, or some other 'real' database. But I digress...
    The only supported way to get the data you want from Access is by... you guessed it... the <b>xMII OLEDB UDS</b>. Sure you could try the JDBC - ODBC bridge, but this seems to be shaky.
    Martin - seriously... I'm trying to get the UDSs out to all of you!

  • Having a problem using an Access 2003 database on a Windows 2012 Server

    We have an old application developed in Visual Basic 6.0 with an Access 2003 database.  We have recently migrated the application from a D-link data server to a new Windows Server 2012.  At first everything seemed OK, but then the application
    began running erratically slower, till after about two weeks it was unusable.  I have found various "fixes" for the problem which seem to have worked for some people and not for others.  We temporarily resolved the problem by rebooting
    the server but do not anticipate that will be a permanent solution.
    The one fix that would apparently work, to update the database to at least Access 2007, is not available to us as we would then have to rewrite our application and we cannot afford to do that. 
    What I am considering doing now is moving the database to a different platform while leaving the application on the network server (Server 2012). 
    In the course of researching the server problem, I encountered some suggestions that Windows 8 is incompatible with Access 2003.  We have one Windows 8 desktop, one XP and the rest are Windows 7. 
    I would be interested in people's opinions as to whether moving the database might solve the problem and also whether the Windows 8 machine might be contributing to the problem.
    LouatMonaco

    For VB6 support you might try here.
    http://www.vbforums.com/forumdisplay.php?1-Visual-Basic-6-and-Earlier
    For access compatability I'd ask over here.
    http://answers.microsoft.com/en-us/office/forum/access?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1412847746948
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • Database options grayed when creating ASP (Javascript) page

    I recently installed CS5 Master Suite on a WinXP-32 machine and was able to create ASP pages in Javascript that could connect to and update a Microsoft Access 2003 database.  But since certain apps in the suite required 64-bit OS, I wiped the machine and installed Windows 7 64-bit.
    I've managed to get it set up so that I can connect to the database if I create a new ASP page with VBScript, but if I create a new page with Javascript, the ability to add a new connection in the database pane is grayed out, despite all the items listed underneath being checked off.
    I assume the DSN is setup correctly since the VBScript pages work.  I've installed IIS7 on the machine with 32-bit application pool enabled so that the server can connect with the 32-bit ODBC driver.
    Any hints on how to get database connection working in Javascript pages would be greatly appreciated!

    Actually, it appears you were right. . .  according to:
    http://help.adobe.com/en_US/dreamweaver/cs/using/WSc78c5058ca073340dcda9110b1f693f21-79e0a .html
    Note: As of Dreamweaver CS5, Dreamweaver no longer installs ASP.NET, ASP JavaScript, or JSP server behaviors. If you’re working on ASP.NET, ASP JavaScript, or JSP pages, however, Dreamweaver will still support Live view, code coloring, and code hinting for those pages. You do not need to select ASP.NET, ASP JavaScript or JSP in the Site Definition dialog box for any of these features to work.
    The only reason I can think that it worked prior to the OS change was that we did have CS4 installed which was later upgraded to CS5.  The pages may have either been created prior to the upgrade or it retained support for ASP Javascript through the upgrade, but no longer had it with the fresh install after the OS change,
    Thanks for the info.  Knowing it was a design decision on Adobe's part made it a bit easier to generate a search to locate the info I was looking for.

  • I want to create a bsp page help me

    i want to create a page
    in which the following should be there,
    1.  A selection screen or a listbox for a pernr field from catsdb,
    2.  according to that pernr no i want to display all that week transaction done by him in catsdb.
    help me please,
    thank you,
    Points will be rewarded
    regards,
    Jagrut BharatKumar Shukla

    Look the following exaplmes for BSP developments.
    http://www.sapdevelopment.co.uk/webapps/bsp/washome.htm
    In your case you can use the HTMLB extensions like.
    dropDownListBox
    listBox
    to display list of PERNS in CATSDB.
    and display the CAT entries in a table view.
    Amandeep

  • Is it possible to create a login page to access the internet without ACS ?

    Hello
    My company would like a solution where guests can only access the intenet with a username or password so a web login page before accessing the internet. is this possible to configure onm a cisco router with no ACS ?
    Thanks
    Andy

    Maybe.
    Are they wired or wireless clients? What model and IOS version is your router and switch?

  • PLZ HELP WITH N95 ACCESS INTERNET AND EATING MY MO...

    Hi could anyone shed some light on my problem? I have a n95 unlocked but was previouse on orange but had to get it unlocked to stop it going on the orange net every hour or so. Iv looked in the manuale and on page 128 it states that to stop this from appening turn off multimedia retrieval. having done this and thought it worked 8 hrs later back to square 1..still access internet and mulitimedia retrieval is turned off still :.( iv tried turning everything off to do with net incl wifi bluetooth ect ect taken the memory card out. reseting to factory settings..in the device mgr my device software is..v11.0.026...plz if anyone can help let me know many thanks...

    Do you have any unsent Multimedia messages in the outbox?
    Do you have installed any other applications that may use data? or have them running in the background?
    Some examples:
    Podcasting
    Browser
    Instant Messaging applications (Windows Live!, Yahoo Go!, etc.)
    VoIP or SIP applications (Fring, Gizmo, etc.)
    Streaming applications (virtual radio, video streaming, Video Center)
    Widsets
    etc.
    If you don't know what's running or what's installed in the device, I recommend that you do a reset to delete all installed applications. Then see if it still connects.
    Cheers!
    640K Should be enough for everybody
    El_Loco Nokia Video Blog

  • I want to create a login form by using servlets with database validation.

    Would you please provide me a code for a login form using servlets with Ms Access database validation?

    No. This is not a free coding service. Your request is (a) ridiculous, (b) offensive, and (c) off-topic. Locking this thread for later deletion.

  • Plz help! How to create a login page

    Hi!
    is there anyone who knows to create a login page from java

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>login1.html</title>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <SCRIPT LANGUAGE="JavaScript">
    function validate(){
    if(document.form1.text1.value.length<1){
    alert("Please enter UserName");
    return false;
    if (document.form1.pwdtext.value.length<3){
    alert("please enter the Password");
    return false;
    return true;
    </SCRIPT>
    </head>
    <body>  <br>
    <form method="get" name="form1" style="" action="./logdb1" enctype ="text/plain" onSubmit = "return validate(this);">
    <p> </p><p> UserName:    <input type="text" maxlength="20" name="text1"></p><p> Password:      <input type="password" maxlength="20" name="pwdtext"></p><p>            <input type="submit" value="Login" name="loginbutton">    <input type="reset" value="Cancel" name="cancelbutton"></p><p> ForgotPassword?     SignUp</p>
    </form>
    </body>
    </html>

  • I was given an ifone 5s that was purchased 3rd hand with an apple id.. I have no idea who the previous owner was.. Can anyone plz help with that issue?? I want to delete the apple id and create a new one????

    HOw can i delete the apple ID that came on a iphone 5s that was purchased 3rd hand and given as a gift to me... Thank you very much for your time and assistance in this mAtter..

    You can’t, and Apple won’t do it for you; the activation lock is an anti-theft measure. Try getting a refund for it.
    (123834)

  • Create a login page using when button is pressed trigger

    I need to write a code that allows users to enter their name and password and there organisation type. If the organisation type entered is staff they are takeing to the appropriate block if it is courts they are taken to another block. This is what I am stuck on. If anyone could help I would be extremley grateful.
    declare
    staff_id varchar2(4);
    user_password varchar2(8);
    org varchar2(10);
    alert_button number;
    begin
    select employee_no,n_password,organisation_type
    into staff_id, user_password,org
    from organisation
    where :login.text_item_user_name=organisation.employee_no and :login.text_item_type= organisation.organisation_type;
    if(staff_id =:login.text_item_user_name AND user_password =:login.text_item_password)
    then go_block('Driving_Test');
    else
    else
    alert_button := show_alert ('Alert_Incorrect_Login');
    if alert_button= alert_button1 then
    clear_block;
    end if;
    end if;
    end if;
    end;

    OK. So does the code work? Are you getting a compilation error? Please be more descriptive. Also, it is helpful if you use the tags round your code so it will be formatted and easier to read. :)  Check out the <a href="http://forums.oracle.com/forums/help.jspa">FAQ </a>link for a list of other useful formatting tags.
    Craig...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Problem more forms in one file

    Hi, I have a problem: I have made a form (http://www.taxikemperman.nl/Urenbriefje.pdf) This is working fine for me, but when I will made more forms and want to combine this into one file than I have a big problem: All the forms get the same input! Ho

  • Error while reading CPS file in jar

    Hi, I am getting error :- Error while initializing CAZM Factory : CardAuthorizationManagerFactory : getFactory : in one of my class in WSAD Root cause i guess its not reading CPS file which is there in one of the jar file. Please help me to get solut

  • Need Help to Generate Tablet Boot Performance Results through Win ADK 8.1!

    I set up the WinADK 8.1 based on client-server model, and run winADK on the server to generate the boot performance (Fast Startup) results for the client: a windows 8.1 Tablet. The test was able to run and complete. There is neither warnings nor issu

  • Adobe Premiere Elements 9 Plus... Am I still being charged for Plus?

    I just saw in my account that there is a yearly "renewal" for Plus and I've never even used the product. How do I find out if I was still being charged? I just saw in my account that there is a yearly "renewal" for Plus and I've never even used the p

  • Macrium Reflect backup Windows 7 to Time Capsule

    I can't get Macrium Reflect (free version) to backup my PC Windows 7 files. The Time Capsule is already being used as a Windows server (Z: drive) to store, access and change files (eg: Word, Excel, PDF, etc documents). I have a folder selected on the