%@ page import="javax.servlet.*" %>
<%@ page import="javax.servlet.http.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="javax.naming.NamingException"%>
<%@ page import="javax.naming.InitialContext"%>
<%@ page import="javax.sql.DataSource"%>
<%
Connection dbCon = null;
PreparedStatement stat = null;
ResultSet rs = null;
String selectstr= "select * from cookingclass where cid =?";
String cat = null;
String productname = null;
int prodid = 0;
prodid = Integer.parseInt(request.getParameter("pid"));
try {
// javax.naming.Context initialContext = new javax.naming.InitialContext();
// javax.naming.Context envContext = (javax.naming.Context) initialContext.lookup("java:/comp/env");
// javax.sql.DataSource dataSource = (javax.sql.DataSource) envContext.lookup("jdbc/mssql");
Class.forName("com.mysql.jdbc.Driver").newInstance();
// dbCon = DriverManager.getConnection("jdbc:mysql://localhost:3306/myrecipe","root","");
// dbCon = DriverManager.getConnection("jdbc:mysql://localhost:3306/maheks_mahek","maheks","mahak");
// dbCon = DriverManager.getConnection("jdbc:mysql://localhost:3309/maheks_mahek","root","");
ServletContext ctx = getServletContext();
String url=ctx.getInitParameter("url");
String user=ctx.getInitParameter("user");
String pw=ctx.getInitParameter("password");
dbCon = DriverManager.getConnection(url,user,pw);
// dbCon = dataSource.getConnection();
stat = dbCon.prepareStatement(selectstr);
stat.setInt(1,prodid);
rs = stat.executeQuery();
int startvalue = Integer.parseInt(request.getParameter("startvalue"));
if(rs.next())
{
%>
<%=rs.getString("seotitle")%>
">
">
|
|
|
|
<%=rs.getString("coursename")%>
|
|
|
| |
 " alt="<%=rs.getString("altbig")%>" width="199"> |
|
|
|
<%=rs.getString("briefdesc")%>
|
|
|
| Course Name : <%= rs.getString("coursename")%> |
|
| Duration :
<%
out.println(rs.getString("duration"));
%>
|
| Week days : <%=rs.getString("weekdays")%> |
| Charges : Rs. <%=rs.getString("charges")%> |
| |
|
Course Details:
<%=rs.getString("description") %>
|
&add=1" > |
|
|
|
|
|
| © 2001-2007 Mahek’s Cooking Classes.
| Web design by livepages |
<%
}
rs.close();
stat.close();
}
catch (java.sql.SQLException e2)
{
out.println(e2.toString());
}
catch (Exception e)
{
out.println("ERROR!
");
out.println("Error = " + e.getMessage() + "
");
e.printStackTrace(new java.io.PrintWriter(out));
out.println("");
return;
}
finally
{
try
{
if(dbCon != null)
dbCon.close();
}
catch(SQLException sqle)
{}
}
%>