Servlet_getparameter
i am doing servlet program ,thru applets by using the control name as parameter to getparameter done,
but by using java swings in designing a screen , and how can i get parameters for getparameter in servlet.
ThanQ sir for giving reply.
I have the program with me as,
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class sendex extends HttpServlet{
public void doPost(HttpServletRequest req,HttpServletResponse res)throws IOException{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}catch(ClassNotFoundException ce){}
try{
Connection con=DriverManager.getConnection("jdbc.odbc.ourdsn","admin","");
Statement st=con.createStatement();
String s1=req.getParameter("t1");
String s2=req.getParameter("t2");
st.executeUpdate("insert into table sendex('"+s1+"','"+s2+"')");
PrintWriter ps=res.getWriter();
ps.println("Data Saved");
}catch(SQLException se){}
Here t1 and t2 are the JTextFields by using swings i did a form,and can i get the values from that form of t1 and t2 as using servlets.
Similar Messages
Maybe you are looking for
-
My new ipod touch is not recognised in itunes or Windows 7 on any of my computers/laptops. I've followed the online advice and still no luck. Help much appreciated!
-
I am splitting a line of text into individual words: String[] tokens; tokens = inputLine.split("\\s+");However, I also need to split words that have a hyphen in them (e.g. hamster-eating monster). How can I do this? Can I split the tokens twice? I ne
-
WebUtil Using Client_Text_IO with Japanese chars
Hi, I am trying to use Client_Text_IO to read text file with Japanese characters in it. But it seems like Client_Text_IO can't read Japanese chars properly. Can anyone tell me how to use Client_Text_IO with double byte chars like Japanese? Thanks in
-
Battery - just keeps on charging!help!
I have an ipod Mini and the battery always lasts 2-3hours before it goes dead (which I always thought was a short life). I charge it on a plug adapter and it usually takes a couple of hours to fully charge to 'charge complete', however, when the batt
-
My contacts are no longer on my ipad? I wasn't syncing I was adding addresses.
I was adding addresses to my contacts on my ipad2 and went i hit done it took me out of contacts. When I went back in all of my contacts are gone. What to do?