ramesh kumar

Ranch Hand
+ Follow
since Nov 16, 2000
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 ramesh kumar

Hi all,
One of my project needs charts. that is the results are to be
extracted from database and displayed in jsp as charts.
I am sucessful until displayinng things in plain table for.
How to incoeporate them in bar chart form?
Any one with suggestion plz help
K.R.kumar
------------------
23 years ago
I had a terrible experience with JWS, as my servlets never refreshed after doing some modifications. I suggest u to change to someother server b4 u spend lot of ur time.
regards
Kumar
23 years ago
You can use Mime type in your
setContentType line.
Let me know whether this one works or not.
Regards
Kumar
------------------
23 years ago
Hi
My program needs to transfer variables from one servlet to another. The following html page runs a servlet and the results
were hyperlinked. when I clik the hyperlinked values it has to
open another web page and as well it has to run a servlet.
I am giving my coding here.

//the servlet program is here.


The concept of the program is to display a file, viz. text file
from the server m/c, giving the correct name. the file name has
to check first whether it is file or directory, then if it is available it has to be shown as hyperliknked. after cliking the link the browser has to either download or display the whole file content.
[I added UBB CODE tags to your source code to make it more readable. Please try to use
them in the future. Learn more about UBB codes here - Ajith ]

[This message has been edited by Ajith Kallambella (edited January 11, 2001).]
23 years ago
HI friends
I got the bug, it is nothing but systax error in sql statement
String stri= "delete members where name=?";
in the above line I missed "from" .
that line should be like
String stri= "delete from members where name=?";
thanks for your help .
Hi Madhav , please with me, I am new to Java, that's y I am here.
regards,
K.R.Kumar
23 years ago
HI friends, below is one of my servlet coding.
please help me to odebug it. it has got as usual sql error, huhhhh.

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class Delete1 extends HttpServlet {
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

String username = req.getParameter("name");
String address = req.getParameter("address");
PrintWriter pw=res.getWriter();
pw.println("Name "+username);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con= DriverManager.getConnection("jdbc:odbc:ramesh","","");
if(con ==null){
pw.println("there is error in connection");}
else{pw.println("wawww there is connection");}

String stri= "delete members where name=?";
PreparedStatement pst=con.prepareStatement(stri);
pst.setString(1,username);
int records = pst.executeUpdate();

pw.println("your record has been deleted in the database");

pst.close();

}
catch(ClassNotFoundException e) {pw.println("there is error");}
catch(SQLException e){pw.println("oops, errorrrrr" +e.getMessage());}

}
}


The result I am getting is below

Name ramesh
wawww there is connection
oops, errorrrrr[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'members where name=Pa_RaM000'.

------------------
23 years ago
HI pals,
my coding gives me error like below in a browser.
I know that it is a sql error. but donno how to solve it, plss help.
the error message is as below.
oops, error[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause
the coding is as below.
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class Delete extends HttpServlet {
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

String username = req.getParameter("name");
String address = req.getParameter("address");
PrintWriter pw=res.getWriter();
pw.println("Name "+username);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con= DriverManager.getConnection("jdbc:odbc:ramesh","","");
if(con ==null){
pw.println("tere is error in connection");}
else{pw.println("wawww there is connection");}

Statement statement=con.createStatement();
ResultSet resultSet=statement.executeQuery("select * from members");
boolean temp=false;
String userID="";

while (resultSet.next())
{
userID=resultSet.getString(1);
temp=userID.equals(username);
if (temp)
{
pw.println("hi user");temp=true;break;}

}
if(temp){pw.println("u r a registered user");

while (resultSet.next())
{
userID=resultSet.getString(1);
temp=userID.equals(username);
if(temp){pw.println("hi user");temp=true;break;}
}
if(temp){pw.println("u r a registered user");
String stri = "delete from members (name, address)" + "values(?,?)";
PreparedStatement stmt = con.prepareStatement(stri);

stmt.setString(1,username);
stmt.setString(2,address);

int row = stmt.executeUpdate();
pw.println("your record has been deleted in the database");

statement.close();}

}

}
catch(ClassNotFoundException e) {pw.println("there is error");}
catch(SQLException e){pw.println("oops, error" +e.getMessage());}

}
}


------------------
23 years ago
HI
I am doing a projects which has to delete a row in a data base
, and the it is a servlet coding.
when executing the code in a browser, i am getting a message viz.
"oops, error[Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause"
kindly go through my coding and let me know the bug plzz

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;
public class Delete extends HttpServlet {
public void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {

String username = req.getParameter("name");
String address = req.getParameter("address");
PrintWriter pw=res.getWriter();
pw.println("Name "+username);
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con= DriverManager.getConnection("jdbc:odbc:ramesh","","");
if(con ==null){
pw.println("tere is error in connection");}
else{pw.println("wawww there is connection");}

Statement statement=con.createStatement();
ResultSet resultSet=statement.executeQuery("select * from members");
boolean temp=false;
String userID="";

while (resultSet.next())
{
userID=resultSet.getString(1);
temp=userID.equals(username);
if (temp)
{
pw.println("hi user");temp=true;break;}

}
if(temp){pw.println("u r a registered user");

while (resultSet.next())
{
userID=resultSet.getString(1);
temp=userID.equals(username);
if(temp){pw.println("hi user");temp=true;break;}
}
if(temp){pw.println("u r a registered user");
String stri = "delete from members (name, address)" + "values(?,?)";
PreparedStatement stmt = con.prepareStatement(stri);

stmt.setString(1,username);
stmt.setString(2,address);

int row = stmt.executeUpdate();
pw.println("your record has been deleted in the database");

statement.close();}

}

}
catch(ClassNotFoundException e) {pw.println("there is error");}
catch(SQLException e){pw.println("oops, error" +e.getMessage());}

}
}


------------------
Hi
Thanks , but I am using Java web server.
So I guess it is necessary to shut down the server every time I
change my class file, Am I right?
Ramesh Kumar
23 years ago
Hi Maha,
Thaks,
I wish you too a wonderful happy new year.
MAY ALL YOUR DREAMS BECOME TRUE THIS YEAR.
Happy new year year friend.
regards,
Ramesh
23 years ago
Yessssssssssss,
u r right. it works.
Is there any way to omit shutting down the server,
as I modify my coding often. If it is possible plsss let me know
regards,
Ramesh
23 years ago
Hi
I am working on servlet projects, and as a new techie I have prob when I try to update a class file. When saving the class
file into the java web server for the first time into the coding works fine. But after doing some modification in the coding and storing the modified compiled class file in the web server, I
still get the same old coding results.
Help me friends, where I am wrong?
regards,
Ramesh
------------------
23 years ago
Thanks pal.
I am using Kawa editor.
Is it possible to change the compiler options so that the compiled class files are stored in web server?.
I am compiling the source code each and everytime I do some modifications, ever then the modifications doesn't comes into effect.
what may be the prob?
regards
Ramesh
------------------
23 years ago
HI pals,
KIndly post the informations and developments about the project here, so that even though I am not a member of your team I may learn some new things. So far I hope you'd have started working on it, where do u stand now?

with regards,
Ramesh

------------------
23 years ago
Hi
I 've been developing servelet programs and I face problems when
I try to run it.
So far I save the compiled class files in c:/Jawa_web_server/servlet .Is that ok?
and one more thing is If I run the servlet for the first time it works as expected. But after modifying the code, and pasting the
the new class file into server, still I get the same old coding results. That is the modification doesn't works.
Please help me.
23 years ago