I'm using odbc:jdbc bridge and an access db and I always get this error: Driver does not support this function

<%@ page import = "java.sql.*" %>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>

<HTML>
<title>Stock Portfolio</title>
<body>
<body bgcolor="gray"><center>
<table border = 1>
<tr>
     <td><th>Symbol</td></th>
     <td><th>Type of Transaction</td></th>
     <td><th>Date</td></th>
     <td><th>Shares</td></th>
     <td><th>Price</td></th>
     <td><th>Stock Commission</td></th>
     <td><th>Stock Brocker Name</td></th>
<tr>

<%     String symbol = request.getParameter("symbol");
       String type = request.getParameter("type");
       String date = request.getParameter("date");
	   String shares = request.getParameter("shares");
	   int ishares = Integer.parseInt(shares);
	   String price = request.getParameter("price");
	   float fprice = Float.parseFloat(price);
	   String commission = request.getParameter("commission");
	   float fcommission = Float.parseFloat(commission);
	   String bname = request.getParameter("bname");
	   
	   
	   
	   
%>
<a href = "StockAgain.jsp"> Add another</a>
<% String url ="jdbc:odbc:Product";
   try
   { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
     Connection con = DriverManager.getConnection(url,"","");
     String query = "INSERT INTO Stock (dbsymbol,dbtype,dbdate,dbshares,dbprice,dbcommission,dbname) VALUES (?,?,?,?,?,?,?)";
     
      PreparedStatement pstmt = con.prepareStatement(query);
      pstmt.setString(1,symbol);
	  pstmt.setString(2,type);
	  pstmt.setString(3,date);
	  pstmt.setInt(4,ishares);
	  pstmt.setDouble(5,fprice);
	  pstmt.setDouble(6,fcommission);
	  pstmt.setString(7,bname);
	  pstmt.executeUpdate(query);
	 }catch (Exception e)
	  {System.out.println(e.getMessage());
	  }
%>

	
</body>
</html>

Can someone please tell me what is wrong with this code?
Thanks

  1. That is what you should tell us
  2. You should not use JSP for DB connectivity
  3. Some stack error messages will really help to solved that mess of code
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.