Hi,
Im writin the followin code to connect with oracle database.im
also using toad .I keep geetin errors even if i declare private String AQC1_UID = "";
and so on..
import java.sql.*;
public class Login {
public static void main(String[] args)
{
String AQC1_UID = "";
String AQC1_USER_PWD = "";
public Login(String AQC1_UID,String AQC1_USER_PWD)
{ this.AQC1_UID=AQC1_UID;
this.AQC1_USER_PWD=AQC1_USER_PWD;
}
/* public void setUsername(String AQC1_UID) {
this.AQC1_UID=AQC1_UID;
}
public void setPassword(String AQC1_USER_PWD) {
this.AQC1_USER_PWD=AQC1_USER_PWD;
}
*/
public boolean validate(String user,String password) {
String query="select * from AIP_QM_CONTROL1";
System.out.println("---------------------"+query);
String DbUserName="";
String DbPassword="";
String finalUser="";
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection
("jdbc:oracle:thin@10.192.22.17:1521:AIPUAT1");
Statement stat=con.createStatement();
ResultSet rst=stat.executeQuery(query);
while(rst.next())
{
DbUserName=rst.getString("AQC1_UID");
DbPassword=rst.getString("AQC1_USER_PWD");
if (AQC1_UID.equals(DbUserName) && AQC1_USER_PWD.equals(DbPassword)) {
break;
}
}
return true;
}
catch(Exception e){
e.printStackTrace();
return false;
}
};
}
}
code showin error while executing in cmd prompt...
illegal start of expression ---public Login(String AQC1_UID,String AQC1_USER_PWD)
^
can you please tell me whats wrong with the code..