Si è una classe servelet ecco il codice:

codice:
package provaprogetto;

import java.io.IOException;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class Inserimento extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet 
{
	
	static String DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
	static String DB_Url = "Jdbc:Odbc:GestioneDocumenti";
	static String titolo;
	static String data;
	int argomento;
	

	public Inserimento(){
		super();
	}
	
	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
		titolo = request.getParameter("Titolo");
		data = request.getParameter("Data_Pubblicazione");
		argomento = request.getIntHeader("Argomento");
		
	}
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
	{
		this.doGet(request, response);
	}


	public static void main(String[] arg) {
		
		try 
		{
		 Connection conn= DriverManager.getConnection(DB_Url);
						//INSERT
	     String sql = "INSERT INTO DOCUMENTI(Titolo,Data_Pubblicazione,rid_argomento,path_allegato,rid_utente) VALUES('"+ titolo + "','" + data + " 00.00','3','C/prog','1')";
		 		 PreparedStatement stmtIns = conn.prepareStatement(sql);
		 stmtIns.executeUpdate();
		 
	     stmtIns.close();
	     conn.close();
		
	    			        	     
	    	conn.close();
	      }
						//IN TUTTI I CASI
		
		catch(SQLException ex) 
		{
	       System.err.println("SQLException: " + ex.getMessage()) ;
	    }
	}

la servlet è salvata su C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\Gest_Doc

grazie