• Post Reply Bookmark Topic Watch Topic
  • New Topic

using declaration and scriptlet in JSP  RSS feed

 
heidi_psl
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai,
iam confused with issue of using declaration and scriptlet tag.

in my code i need to initialze Statement,Resultset.....
if i do that as below
<%!
Statement st=null;
ResultSet rs=null,rs1=null;
ArrayList al=null,custal=null;
int pid=0,si=0;
PreparedStatement ps=null;
String enqT=null,poT=null,serviceT=null;
%>at the end iam closing stmt & rs in finlly block

will there be any problem if i do this.coz code in declrtion tag will execute only once & not for every request.

i think thr is no need to initialize in this block.

one more thing wat is the default initial value of String var? null/space

thanx in adv.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry, I won't comment on your first question, it kills me to see JDBC code in a jsp page

About your second question, String's default value is null.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!