I am using my own Java objects in ColdFusion. Whenever, I try
to make an instance of my class, it gives me an error:
"Unable to find a constructor for class dssLogin that
accepts parameters of type ( java.lang.String, java.lang.String )
". Similar for any methods of this class.
I am compiling it using version 1.4 which is compatible to
ColdFusion. I am using the following code in my class:
import java.sql.*;
class dssLogin
{
String username;
String password;
boolean status;
int site;
int patientCount;
String [] patientList;
String query;
int currentPatient;
dssLogin(String uname, String pword)
{
username = uname;
password = pword;
status = false;
site = -1;
patientCount = 0;
currentPatient = 0;
query = "select * from admin where username = '" + username
+ "' and password = '" + password + "'";
}
void verify()
{
}
}
I am using the following code in coldfusion
<cfset dssLog = createObject( "java", "dssLogin" ) >
<cfset user = #Form.username# >
<cfset pword = #Form.password# >
<cfset obj1 = dssLog.init(user, pword)>
<cfset obj2 = dssLog.verify()>