View Single Post
  #1 (permalink)  
Old 07-02-2007, 01:33 AM
Eric Eric is offline
Senior Member
 
Join Date: Jun 2007
Posts: 111
Eric is on a distinguished road
JTextFields with username & password.
What is the best way of implementing with JTextFields a username system.
For example to get onto a database you need a username & password, if my GUI prompts for these, what do I need to do to parse this information into my code.
For example in my file I have:

Code:
static final String USERNAME = "root";
Code:
tableModel = new ResultSetTableModel1( JDBC_DRIVER, DATABASE_URL, USERNAME, PASSWORD, DEFAULT_QUERY );
Code:
public ResultSetTableModel1( String driver, String url, String username, String password, String query ) throws SQLException, ClassNotFoundException { // load database driver class Class.forName( driver ); // connect to database connection = DriverManager.getConnection( url, username, password );
Thanks.
Eric
Reply With Quote
Sponsored Links