• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Writing a simple Oracle DB program in Netbeans 6.1

 
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 ]
 
author & internet detective
Posts: 39343
755
Eclipse IDE VI Editor Java
  • 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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!