?
Solved

Java & Oracle: How do I create a login form in Java?

Posted on 2004-09-13
7
Medium Priority
?
242 Views
Last Modified: 2010-03-31
I've read through old solutions, but my reference to the GUI is a little rusty so I wonder. Would it be possible for someone here to create a form for me? A plain login form, where you type your username and your password and click OK, and get submitted to another form if authenticated. If not authenticated then show error message and log in once more.

Gonna use it on website... So I'll send credits to the one that answers best.

Will be greatly appreciated,
eX.

0
Comment
Question by:Gaute Rønningen
  • 3
  • 2
  • 2
7 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 2000 total points
ID: 12042415
0
 

Author Comment

by:Gaute Rønningen
ID: 12042417
By send credits I mean, not in $$$, but in link to website or profile here or whatever chosen...
0
 
LVL 37

Expert Comment

by:zzynx
ID: 12042422
We're here to help you if you have problems with something you wrote on your own.
We're not allowed to write whole bunches of code for you.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 37

Expert Comment

by:zzynx
ID: 12042434
Maybe this can be useful for you: http://javaalmanac.com/egs/java.sql/ConnectOracle.html
0
 

Author Comment

by:Gaute Rønningen
ID: 12042435
Well then...

Here's what I have so far:
import java.sql.*;

public class EnkelDatabaseklient {
    public static void main(String[] args) {
        String driver = "oracle.jdbc.driver.OracleDriver";
        String database = "jdbc:oracle:thin:@oracle.nith.no:1521:STUD";
        String brukernavn = args[0];
        String passord = args[1];
            try {
                  Class.forName(driver);
              Connection forbindelse =
                    DriverManager.getConnection(database, brukernavn, passord);
              Statement setning = forbindelse.createStatement();
              String sporring = "select * from personer";
              ResultSet radsett = setning.executeQuery(sporring);
              while (radsett.next())
                  System.out.println(radsett.getInt("NR") + " " +
                                      radsett.getString("FORNAVN") + " " +
                                      radsett.getString("ETTERNAVN") + " " +
                                      radsett.getString("ADRESSE") + " " +
                                      radsett.getInt("POSTNUMMER") + " " +
                                      radsett.getString("TELEFON"));
              setning.close();
              forbindelse.close();
            }
            catch ( ClassNotFoundException cnfex) {      //koblet til 1)
               System.out.println("Feilet med å laste driveren: " + cnfex.getMessage());
               System.exit(1);
            }
            catch ( SQLException sqlex) {      //koblet til 2) og 3)
               System.out.println("Tilkobling ikke mulig: " + sqlex.getMessage());
               System.exit(1);
            }
    }
}

And I need the GUI part, but I don't remember how to do it...
0
 
LVL 35

Expert Comment

by:girionis
ID: 12042466
Look at the link I posted for the GUI part.
0
 
LVL 35

Expert Comment

by:girionis
ID: 12042620
:)
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question