אז ככה כתבתי את הדף הזה ב-JSP עכשיו יצרתי חיבור עם ה- HSQL וזה מכניס לי תנתונים והכל טוב ויפה אבל אבל אני רוצה ליצור מצב שהנתונים יכנסו על ידי מה שהמשתמש יזין ולא מה שאני הצבתי אשמח לדעת מה אני צריך לעשות בטופס כדי שזה יתבצע תודה לעוזרים זה הטופס
[code]
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="javax.sql.DataSource"%>
<%@page import="javax.naming.InitialContext"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
http://www.w3.org/TR/html4/loose.dt?...>
Students marks
<%
Connection con = null;
//connect the jboss services
InitialContext ic = new InitialContext();
//get the reference to the datasource
DataSource ds = (DataSource) ic.lookup("java:/DefaultDS");
//create a connection to the database in the ds
con = ds.getConnection();
//execute a statement
PreparedStatement pr = con
.prepareStatement("INSERT INTO PUBLIC.STUDENTS VALUES(?,?,?)");
pr.setString(1, "AVI");
pr.setString(2, "ENGLISH");
pr.setDouble(3, 100.0);
pr.executeUpdate();
%>
[/code]