Solved

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

Posted on 2004-09-13
7
231 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 500 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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Java 1603 Error 3 45
factorial example challenge 10 62
countX 22 70
java. non-English characters encoding problem. intellij idea 3 46
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now