Raghav

Greenhorn
+ Follow
since Jul 24, 2001
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 Raghav

Hi,
Does some thing need to be specially configured in tomcat to make it serve for internet
we had a development tomcat serve fine on the intranet ,
but when installed tomcat on external facing box
it gives out Gateway error
any help is appreciated
-raghav
15 years ago
One of them I am using is

http://community.isavvix.com/

free sign up ,good file manager,10mb space

raghav
16 years ago
hi,
If u can post the error messages that will help to find out the problem.so do post the error messages
regards
raghav
16 years ago

Originally posted by Maheshwari J:
I have stored image files in a database. Is there any way to display that image in a web browser by querying the database?


Hi,
I think these links show how to insert and retrive images from a database ,i hope this will be helpful for u
http://developer.java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/BLOBPut/index.html
http://developer.java.sun.com/developer/onlineTraining/Database/JDBC20Intro/exercises/BLOBGet/index.html
regards
raghav
16 years ago
Hi,
1.)I think the first error lies in you Class.forName() line of code . it must be
Class.forName("org.gjt.mm.mysql.Driver");
2.) I think the insert statement u are using must be like st.executeUpdate("INSERT INTO PROJECT VALUES('"+fName+"', '"+lName+"', '"+emailAddress+"', '"+idnumber+"', '"+pWord+"')");
3. try giving the connection like
DriverManager.getConnection(url,"","");
try changing all these see if it works if u can post the error too that will be fine .
regards
raghav

Originally posted by Jo Lee:
I have the same problem. I want to learn to develop for oracle database and downloaded oracle 8i at home, installed it on my windows NT 4 workstation. However, I am stopped at here, do not know how to proceed. I thought it would have a default user, but do not know the user name and password, any pointer to the right direction is greatly appreciated.
My eventual goal is to develop for Database.
Thanks



Hi Lee,
U can try doing
User: scott
PAssword:tiger
DSN rcl
try this out , may help u
Try to read the help files
raghav
Hi,
I am trying to insert multiple values into multiple tables at a single instance.I have a HTML form and Servelt that connects me to the MSAccess database . i have 4 different tables in the database.and i want to enter the values in the form to these tables in a single submit button click. i tried doing
Statement st = conn.createStatement();
st.addBatch("insert into table 1");
st.addBatch("insert into table 2");
st.addBatch("insert into table 3");
st.addBatch("insert into table 4");
int [] count = st.executeBatch();
but i am getting a error all the time i do it this way , is this any other way to carry out this type of operation.
thanks
raghav

Hi,
I am trying to insert data from html page through post operation into a MYSQL database through a servelt, every time i enter a value in the html page and submit , i get a IllegalAccessException , can any body help me , i have attached the code below and the error below ,
servlet code:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
class insert extends HttpServlet
{
Connection conn=null;
Statement st=null;
ResultSet rs=null;
PreparedStatement pst=null;
public void init(ServletConfig cfg) throws ServletException
{
try
{
super.init(cfg);
Class.forName("org.gjt.mm.mysql.Driver");
conn = DriverManager.getConnection("jdbc:mysql://localhost/mysql?user=root&password=******","root","******");

}
catch(SQLException se)
{
}
catch(ClassNotFoundException ce)
{
}
}
public void service(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
{
doPost(req,res);
}
public void doPost(HttpServletRequest req,HttpServletResponse res) throws IOException,ServletException
{
try
{
String aged = req.getParameter("age");
String query = "insert into rag(age) values(?)";
pst=conn.prepareStatement(query);
pst.setString(1,aged);
pst.executeUpdate();
PrintWriter pw = res.getWriter();
pw.println("done");
pw.close();
}
/*catch(Exception e)
{
System.out.println("class not found");
//e.printStackTrace();
}*/
catch (SQLException se) {
System.out.println("SQLException: " + se.getMessage());
System.out.println("SQLState: " + se.getSQLState());
System.out.println("VendorError: " + se.getErrorCode());
}
}
public void destroy()
{
try
{
rs.close();
conn.close();
}
catch(Exception e){}
}
}
error when invoked from a html page:
Error: 500
Internal Servlet Error:
java.lang.IllegalAccessException: insert
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.web.core.ServletWrapper.loadServlet(ServletWrapper.java:90)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:109)
at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
at com.sun.web.core.Context.handleRequest(Context.java:375)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:135)
thanks
raghav
16 years ago
hi,
I am trying to get some values from a html page into a MYSQL databse through a servlet , my problem is when i enter a value a press submit , the illegal access exception is thrown ,I had the same problem with MSaccess database , but if we give a blank user and password in the getConnection() method , then it works fine . but when i try the same with MYSQL , it still throws a IllegalAccessException,I tried to do this as a simple database application passing the value to be inserted in the commandline parameter it worked fine , it throws this exception only when done as a servlet. Does anybody knows how to create a system dsn entry for MYsql in (controlpanel->odbc) like we do for MSaccess database.Any comments will be appreciated.
thanks
raghav
16 years ago
hi,
great man , after i give the blank username and password in the parameter it has started working , was it the javasecurity policy which was stopping it . But when i run it as a application it works fine .any way thanks man , will be back with more queries.
raghav
16 years ago
hi ,
i checked all the thing still i am getting the Error:500 thing ,Internal Servlet Exception , it says it is a illegalaccessexception, i tried the same code as a jdbc application it worked fine , but when used with servlet its giving trouble , what can be the problem be , any way thanks for your help
raghav
16 years ago
hi,
i am attaching the code of the html page calling the servlet and the servlet code ,please help me with the problem
html page code:
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<form method="POST" action="http://localhost:8080/examples/servlet/booklist">
<p><input type="submit" value="ShowBooks" name="B1"></p>
</form>
</body>
</html>
servlet code:
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public class booklist extends HttpServlet
{
Connection dbconn;
Statement st;
ResultSet rs;
PrintWriter pw;
public void init(ServletConfig cfg) throws ServletException
{
try
{
super.init(cfg);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
dbconn=DriverManager.getConnection("jdbc dbc:bookstore");
}
catch(SQLException se)
{
}
catch(ClassNotFoundException ce)
{
}
}
//public void service(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
//{
//doPost(request,response);
//}
public void doPost(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
{
try
{
st=dbconn.createStatement();
String query = "Select a.lastname,a.firstname,b.isbn,c.title,d.name from authors a,auth_books b, books c,publishers d where a.authid=b.authid AND b.isbn = c.isbn AND c.pub_code = d.pub_code";
rs = st.executeQuery(query);
response.setContentType("text/html");
pw = response.getWriter();
pw.println("<html>");
pw.println("<head>");
pw.println("<title>");
pw.println("List of Books ");
pw.println("</title>");
pw.println("</head>");
pw.println("<body bgcolor = lightblue>");
pw.println("<table border=1>");
pw.println("<tr><th>ISBN</th><th>Title</th><th>Author</th><th>Publisher</th></tr>");
while(rs.next())
{
pw.println("<tr>");
pw.println("<td>");
pw.println(rs.getString("isbn"));
pw.println("</td>");
pw.println("<td>");
pw.println(rs.getString("title"));
pw.println("</td>");
pw.println("<td>");
pw.println(rs.getString("lastname")+""+rs.getString("firstname"));
pw.println("</td>");
pw.println("<td>");
pw.println(rs.getString("name"));
pw.println("</td>");
pw.println("</tr>");
}
pw.println("</table>");
pw.println("</body>");
pw.println("</html>");
}
catch(SQLException se1)
{
}

}
public void destroy()
{
try
{
pw.close();
rs.close();
dbconn.close();
}
catch(Exception e){}
}
}
thanks for the help
raghav
16 years ago
hi,
i am trying a small program on interaction with jdbc and servlet , I am having a html page with a button , which when pressed invokes a servlet through post method which prints out a list of book in the database with its author,isbn etc. when i load the html page and click the button , i get a error error:500 ,the error looks as following:
Error: 500
Internal Servlet Error:
java.lang.IllegalAccessException: booklist
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.web.core.ServletWrapper.loadServlet(ServletWrapper.java:90)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:109)
at com.sun.web.core.InvokerServlet.service(InvokerServlet.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:140)
at com.sun.web.core.Context.handleRequest(Context.java:375)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:135)
if any body can solve the problem ,i would be great , i am running the program on win98,jsdk2.1 and jdk1.3
thanks
raghav
16 years ago
hi,
i am trying to do a server side include program . i have included the <server code="some servlet"></server> in a file X.shtml and called it my browser . the servlet doesnt execute .
i am running on win98,jdk1.3,jsdk2.1 what can be the problem.can anybody help me .
regards
raghav
16 years ago