arun andrew

Greenhorn
+ Follow
since Dec 21, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by arun andrew

hi,
have you tried Javamail API.....its very useful for sending emails...
regards
19 years ago
hi,
why don't you store those values in a database and let the other servlet acess the database.
regards
andrew
19 years ago
hi,
thank you for the suggestions.i didn't change the name request but when i restarted the TOMCAT server the error is gone.i don't know how it happened but nonetheless am happy.guess whenever you make changes in the servlet code its better to restart the server otherwise the old values will be repeated or something.hope someone can give a better answer.
regards
Andrew
19 years ago
hi,
i wrote a servlet which accepts two variables num(int) and nam(string) from an html form.now i want to write that data into the postgresql database.could some body show how i could write such a code.am fairly new to servlet programming...
regards
19 years ago
hi,
can somebody please tell where i can find good reading material for java servlets and jdbc.a beginners tutorial with a comprehensive list of topics discussed with examples is welcome.i have a project in that and i cannot make head or tail of this topic...so please help.....
regards
racerjavascript: x()
19 years ago
hi ,
i wrote an html file
....
<form name="Post your reminders here"
method="POST"
action="http://localhost:8080/examples/servlet/request">
....
and the request.java is
import java.io.*;
import javax.servlet.*;
import java.sql.*;
import java.text.*;
import java.util.*;
import javax.servlet.http.*;

public class request extends HttpServlet
{
public String getServletInfo()
{
return " Servlet connect to database and show the result of a SELECT";
}
private Connection dbcon;
public void init(ServletConfig config) throws ServletException
{
String loginUser="postgres";
String loginPasswd="postgres";
String loginUrl="jdbc ostgresql://localhost/remind";
try
{
Class.forName("org.postgresql.Driver");
dbcon=DriverManager.getConnection(loginUrl,loginUser,loginPasswd);
}
catch (ClassNotFoundException ex)
{
System.err.println("ClassNotFoundException:"+ex.getMessage());
throw new ServletException("Class not found Error");
}
catch(SQLException ex)
{
System.err.println("SQLException:"+ex.getMessage());
}

}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
{
response.setContentType("text/html");
PrintWriter out=response.getWriter();
out.println("<HTML><Head><Title>REQUEST</Title></Head>");
out.println("<Body><H1>REQUEST</H1>");
try
{
Statement statement=dbcon.createStatement();

String query="SELECT * FROM remind";
ResultSet rs=statement.executeQuery(query);
out.println("<TABLE border>");
while(rs.next())
{
String m_name=rs.getString("name");
String m_time=rs.getString("time");
String m_subject=rs.getString("subject");
out.println("<tr>"+
"<td>"+m_name+"</td>"+
"<td>"+m_time+"</td>"+
"<td>"+m_subject+"</td>"+
"</tr>");
}
out.println("</TABLE></Body><HTML>");
statement.close();
}
catch(Exception ex)
{
out.println("<HTML>" +
"<Head><Title>" +
"remind:Error" +
"</Title></Head>\n<Body>"+
"<P>SQL error in doGet:" +
ex.getMessage() +"</P></Body></HTML>");
return;
}
out.close();
}
}
the database is in postgresql
now when i access the html file i get the error

HTTP method POST is not supported by this URL
could somebody help me?
19 years ago
Hi all,
I am a newbie programmer and i want to make a database of reminders which a user can enter through an html page and at the appointed time a pop up window will come reminding the user. i plan to use POSTGRESQL for database and jdbc to connect and plan to run the servlet on a tomcat.now my biggest problem is how can i keep track of the times in the database and act when the time is come....
regards
19 years ago