|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
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 java.io.*; 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(); response.setContentType("text/html"); try { Class.forName("twz1.jdbc.mysql.jdbcMysqlDriver"); // pw.println("Raghu"); Connection con = null; DriverManager.getConnection("jdbc:z1MySQL://localhost/chemnet?username=root&password=jack"); pw.println("Raghu"); Statement st = con.createStatement(); pw.println("Raghu"); ResultSet rs = null; pw.println("Raghu"); any help from ur side will be appreciated. ------------------ |
|
#2
|
|||
|
|||
|
If the resultset is null the document not contain data. If the resultset not have code
Ex. "select * from xxxx", this no is necesary . |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > jserv and Mysql |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|