Hi all,
I have a multi-threaded environment.
I have a JDBC class that connects to the database.
I also have a class called, Query, that has static methods and a static instance variable of the JDBC class.
Each method executes a specific SQL statement and it uses the JDBC static instance variable to connect to the database.
My Questions:
1) Does it help or hurt performance that my Query class is static and threads do not have to instantiate new instances of Query.
2) Should I make methods of my JDBC class static as well?
3) Is there any performance difference if the static methods in my Query class is using static instance variables.
I greatly appreciate the help.
Thanks,
Spence
I have a multi-threaded environment.
I have a JDBC class that connects to the database.
I also have a class called, Query, that has static methods and a static instance variable of the JDBC class.
Each method executes a specific SQL statement and it uses the JDBC static instance variable to connect to the database.
My Questions:
1) Does it help or hurt performance that my Query class is static and threads do not have to instantiate new instances of Query.
2) Should I make methods of my JDBC class static as well?
3) Is there any performance difference if the static methods in my Query class is using static instance variables.
I greatly appreciate the help.
Thanks,
Spence