Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Writing a simple Oracle DB program in Netbeans 6.1

 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I may have it, not sure yet. Nope still lost.
[ November 14, 2008: Message edited by: James Hambrick ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
James,
Have you seen the JDBC tutorial yet? What code do you have so far? Can you create a connection? statement?
 
James Hambrick
Ranch Hand
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 282
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic