<%@ page import="javax.servlet.*" %> <%@ page import="javax.servlet.http.*" %> <%@ page import="java.sql.*" %> <%@ page import="java.util.*" %> <%@ page import="javax.naming.NamingException"%> <%@ page import="javax.naming.InitialContext"%> <%@ page import="javax.sql.DataSource"%> <% Connection dbCon = null; PreparedStatement statweek = null; PreparedStatement statrecom = null; ResultSet rsweek = null; ResultSet rsrecom = null; String cat = null; String subcat = null; String strweek="select * from proddetails where recipeoftheday=?"; String strrecom="select * from proddetails where recommended=?"; int catid=0; String fl="Y"; 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"); //dbCon = dataSource.getConnection(); Class.forName("com.mysql.jdbc.Driver").newInstance(); //dbCon = DriverManager.getConnection("jdbc:mysql://localhost:3306/maheks_mahek","maheks","mahak"); ServletContext ctx = getServletContext(); String url=ctx.getInitParameter("url"); String user=ctx.getInitParameter("user"); String pw=ctx.getInitParameter("password"); dbCon = DriverManager.getConnection(url,user,pw); statweek=dbCon.prepareStatement(strweek); statweek.setString(1,fl); rsweek=statweek.executeQuery(); statrecom=dbCon.prepareStatement(strrecom); statrecom.setString(1,fl); rsrecom=statrecom.executeQuery(); %> Mahek's Cooking Classes
 

A recipe is a set of instructions that show how to prepare or make something, especially a culinary dish

  • The name of the dish.
  • How much time it will take to prepare the dish .
  • The required ingredients along with their quantities or proportions.
 
 
Featured Recipe of the week
<% if (rsweek.next()){ //out.print(rs.getString("thumbnail")); %>
     
&startvalue=0">" border="0" width="100">
  &startvalue=0"><%=rsweek.getString("productname")%>
  Submitted by
<%=rsweek.getString("postedby")%>
     
<% } %>
Recommended Recipes
     
<% if (rsrecom.next()){ //out.print(rs.getString("thumbnail")); %> &startvalue=0">" width="100"> <% } %>
  &startvalue=0"><%=rsrecom.getString("productname")%>
 
 
 
     
 
 
Browse Recipes
We have hundreds of recipes both for beginners and for experts.Browse our collection as per your needs.
 
Submit your recipe
Have you made something you want everyone to know.Well, here is where you can showcase your own recipe.
 
Ingredient substitutions
We always forget to have something at the last moment.Find here tons of ingredient replacements.For a change you would want to use it always in your next creation.
 
 

 

<% } 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) {} } %>