Thread: jserv and Mysql

  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Rep Power
    We need help urgently. The setup is like this , we have a linux 6.1 m/c with Apache and Jserv for our servlets, the servlets
    use Mysql database for dynamic pages.
    The driver we use on the servlet is "twz1JDBCFORMysql".

    The problem comes up when we start mysql on the Linux machine. Only when we start mysql server with "mysqld -Sg"
    does the servlets work, if we start mysql with the -Sg option we are able to connect to the database from a windows GUI
    and also from the linux command mode.But when we run a servlet on the browser we get a message saying" Document
    contains no data. debugging shows that the driver is OK but the program has problem at the connection url.

    part of the code is given here:
    import javax.servlet.*;
    import javax.servlet.http.*;

    //import exjava.sql.*;
    //import exgwe.sql.*;

    //import twz1.jdbc.mysql.*;
    import java.sql.*;

    import java.util.Date;
    import java.text.DateFormat;

    public class ClassDisplay extends HttpServlet {

    public void service(HttpServletRequest request, HttpServletResponse response)
    throws IOException, ServletException {

    PrintWriter pw = response.getWriter();

    try {

    // pw.println("Raghu");

    Connection con = null;
    pw.println("Raghu"); Statement st =
    con.createStatement(); pw.println("Raghu");
    ResultSet rs = null;
    any help from ur side will be appreciated.


    Comments on this post

    • JimmyGosling agrees
    • BaronVonDoppleG agrees
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Rep Power
    If the resultset is null the document not contain data. If the resultset not have code
    Ex. "select * from xxxx", this no is necesary

IMN logo majestic logo threadwatch logo seochat tools logo