K
knightowl
Please take a look at the following code section. In this module the
static "qt" becomes null when the constuctor is fired, very similar
code works find in other places in my program. I don't think the
QueryTools class is a problem because I can use the code elsewhere.
public class Authorization
{
static public String TABLE ="authorization";
static private String POOL_NAME = "mysql-invoice-system";
static private QueryTools qt;
static
{
System.out.println("Static Section " + POOL_NAME);
QueryTools qt = new QueryTools(POOL_NAME);
System.out.println(qt);
System.out.println("Static Section End " + POOL_NAME);
}
public Authorization()
{
System.out.println("Authorization Constructor");
System.out.println("QT=" + qt);
}
Here is the output from Netbeans:
run:
Static Section mysql-invoice-system
com.ciorent.HFCConnectionPool.QueryTools@18e2b22
Static Section End mysql-invoice-system
Authorization Constructor
QT=null
Here is the calling code:
Authorization a = new Authorization();
try
{
a.createAccount("(e-mail address removed)", "test4200", 10000);
}
catch (Exception e)
{
System.out.println(e);
}
System.exit(1);
I am going to bet this is something simple that I am missing, hopefully
someone will be able to point out my error.
Thanks
HFC
static "qt" becomes null when the constuctor is fired, very similar
code works find in other places in my program. I don't think the
QueryTools class is a problem because I can use the code elsewhere.
public class Authorization
{
static public String TABLE ="authorization";
static private String POOL_NAME = "mysql-invoice-system";
static private QueryTools qt;
static
{
System.out.println("Static Section " + POOL_NAME);
QueryTools qt = new QueryTools(POOL_NAME);
System.out.println(qt);
System.out.println("Static Section End " + POOL_NAME);
}
public Authorization()
{
System.out.println("Authorization Constructor");
System.out.println("QT=" + qt);
}
Here is the output from Netbeans:
run:
Static Section mysql-invoice-system
com.ciorent.HFCConnectionPool.QueryTools@18e2b22
Static Section End mysql-invoice-system
Authorization Constructor
QT=null
Here is the calling code:
Authorization a = new Authorization();
try
{
a.createAccount("(e-mail address removed)", "test4200", 10000);
}
catch (Exception e)
{
System.out.println(e);
}
System.exit(1);
I am going to bet this is something simple that I am missing, hopefully
someone will be able to point out my error.
Thanks
HFC