My problem is not solved. My package is kept in "WEB-INF/classes/connection" and jsp is kept in same level of folder stucture where WEB-INF is kept. My error message is "Package connection not found in import"
I am using this syntax to import the package. <%@page language="java" import="java.sql.*,connection.*" %>
I am using solaris OS with tomcat version 3.2.4. Can anybody tell me where I am going wrong.
"confused confused", you have previously been warned on one or more occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it prior to your next post.
Your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.
Be aware that accounts with invalid display names are disabled.
Hi Preeti, I think it'll be better if you place all your class files in a package inside the src folder and the jsp files into another in the web folder, and then import all those classes from there into their respective jsp files. Now, you can create a db connection class file and place it in the same package to that of other class files.
CONPool is the pool name that is coming from your ds.xml file.
Import DbConnection in each of the class files for the JSP pages. Create the connection globally inside the class by calling the method getConn() in a costructor, and use it to call your db procedures. Remember to create a method closing the connection at the end of the class file. You can close the connection by calling this method at the end of its respective jsp file.
"Nishant Kr", you have previously been warned on multiple occasions regarding adjusting your display name to meet JavaRanch standards. This is not optional, and this is your final warning. Adjust your display name to comply with the required standards prior to your next post.
Failure to comply will result in the removal of your account.
bear JavaRanch Sheriff
Joined: Aug 08, 2008
Thank you All for resonding my problem. As per the convention I have kept my package in the WEB-INF/classes folder. But still not able to import the PACKAGE. My jsp is saying package not found ti import. Tell me something my i have complied my class jsdk1.4 and in the server my jsdk version is 1.5 . IS there any versiing problem.
I don't want to follow other way apart from package import to access connection class. Can any body post the code where I can include jsp connection file in other file.
Please help me as soon as possible. I am really in trouble. For Information: OS- solaris 5.10, tomcat -3.2.4, jDk 1.5