| Author |
Writing a simple Oracle DB program in Netbeans 6.1
|
James Hambrick
Ranch Hand
Joined: Sep 04, 2004
Posts: 277
|
|
Okay I have downloaded the driver needed and connected to the oracle DB, I have created the GUI(it's a login page). I have the username sent to a string and the password sent to a string. How do I query the oracle DB to check for the validity of the username/password entered? Not sure how to send queries to Oracle. I would like to use Netbeans as much as possible, but I understand and I will have to code some of it. [ November 14, 2008: Message edited by: James Hambrick ]
|
Visit my blog! http://jameshambrick.com
|
 |
James Hambrick
Ranch Hand
Joined: Sep 04, 2004
Posts: 277
|
|
I may have it, not sure yet. Nope still lost. [ November 14, 2008: Message edited by: James Hambrick ]
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26193
|
|
James, Have you seen the JDBC tutorial yet? What code do you have so far? Can you create a connection? statement?
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
James Hambrick
Ranch Hand
Joined: Sep 04, 2004
Posts: 277
|
|
No I have not seen that tutorial yet. I have used Netbeans to create the connection so the code is automatically created and it works because I can see the list of tables in the left hand box(on the IDE). I have code for when the user clicks the login button(i'm not at work so I cannot exactly recreate the code). i use a password text box for the password. String strusername = ""; String pwspassword = ""; int x = 0; chr[] chrpassword;//probably not he exact code don't remember strusername = jtxtusername.getText(); //here i will check for username, if not correct give error and clear //txtboxes chrpassword = jpwdpassword.getText(); for(int i:chrpassword){ strpassword = strpassword + chrpassword[x]; x++; //here I will query the DB for check for password } I am also getting help on netbeans forum and they gave me code to do it, but it's a class and I think netbeans have created one for me since I have setup the entity manager in netbeans.
|
 |
James Hambrick
Ranch Hand
Joined: Sep 04, 2004
Posts: 277
|
|
I can write data to the table but can't query. gives an illegalArgumentException Here's where I run the query
|
 |
James Hambrick
Ranch Hand
Joined: Sep 04, 2004
Posts: 277
|
|
|
If someone could just post an example that I could go by. I'm still at the problem where it does not like the SQL statment.
|
 |
 |
|
|
subject: Writing a simple Oracle DB program in Netbeans 6.1
|
|
|