sessions in tomcat

2002-02-27 Thread vinny patel

hi,
i am having problems creating a session id of my own.
i have tried the setId(), but comes up with a error
message when it comes it compiling it

can someone please help me!

thanks

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




JDBC

2002-02-11 Thread vinny patel

I am having problems with my servlets that connect to a postgres
database. I am using the Tomcat 4, if anyone has any suggestions, i would be 
gratefull!

thanks

_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: JDBC

2002-02-11 Thread vinny patel

this is the error message

**
Cant find database Driver class: java.lang.ClassNotFoundException: 
postgresql.Driver
SQL Exception java.sql.SQLException: No suitable driver
**

and heres the coding

*
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

  public class hotellist extends HttpServlet
  {
   public void doGet(HttpServletRequest req,
 HttpServletResponse res)
   throws ServletException, IOException
   {
 res.setContentType(text/html);
 PrintWriter out = res.getWriter();
 String url =
   jdbc:postgresql://dcsun2/dwt;
 String query =  select name,city from hotels order by city,name;

 out.println(HTML);
 out.println(BODY);


 try
 {
   Class.forName(postgresql.Driver);
 }
 catch(java.lang.ClassNotFoundException ex1)
 {
   out.println(Cant find database Driver class:  + ex1 +BR);
 }

 try{
   Connection con = 
DriverManager.getConnection(url,wwwuser,wwwuser);
   Statement stmt = con.createStatement();
   ResultSet rs =stmt.executeQuery(query);
   out.println(P STRONGHotel ---   City/STRONG);
   while (rs.next())
   {
 String hotelName = rs.getString(1);
 String cityName = rs.getString(2);
 out.println(BR  + hotelName +  ,  + cityName);
   }
   out.println(/P);
   stmt.close();
   con.close();
 }
 catch(SQLException ex2)
 {
   out.println(SQL Exception  + ex2);
 }
 out.println(/HTML);
 out.println(/BODY);
   }
}


***

i believe it's something to do with the postgres driver?

cheers


From: Brian Adams [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Subject: RE: JDBC
Date: Mon, 11 Feb 2002 06:33:35 -0600

what problems are you having?  can you post an error or code or both?
B

-Original Message-
From: vinny patel [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 3:48 AM
To: [EMAIL PROTECTED]
Subject: JDBC


I am having problems with my servlets that connect to a postgres
database. I am using the Tomcat 4, if anyone has any suggestions, i would 
be

gratefull!

thanks

_
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: JDBC

2002-02-11 Thread vinny patel


sorted!

thanks brian, i'll buy u a drink if i ever go to the states!!
cheers

From: Brian Adams [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: 'Tomcat Users List' [EMAIL PROTECTED]
Subject: RE: JDBC
Date: Mon, 11 Feb 2002 06:53:58 -0600

where did you put your jdbc driver jar?  mine is named jdbc7.0-1.2.jar and
it is in my tomcat's common\lib directory.
B

-Original Message-
From: vinny patel [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 11, 2002 6:48 AM
To: [EMAIL PROTECTED]
Subject: RE: JDBC


this is the error message

**
Cant find database Driver class: java.lang.ClassNotFoundException:
postgresql.Driver
SQL Exception java.sql.SQLException: No suitable driver
**

and heres the coding

*
import java.io.*;
import java.sql.*;
import javax.servlet.*;
import javax.servlet.http.*;

   public class hotellist extends HttpServlet
   {
public void doGet(HttpServletRequest req,
  HttpServletResponse res)
throws ServletException, IOException
{
  res.setContentType(text/html);
  PrintWriter out = res.getWriter();
  String url =
jdbc:postgresql://dcsun2/dwt;
  String query =  select name,city from hotels order by city,name;

  out.println(HTML);
  out.println(BODY);


  try
  {
Class.forName(postgresql.Driver);
  }
  catch(java.lang.ClassNotFoundException ex1)
  {
out.println(Cant find database Driver class:  + ex1 +BR);
  }

  try{
Connection con =
DriverManager.getConnection(url,wwwuser,wwwuser);
Statement stmt = con.createStatement();
ResultSet rs =stmt.executeQuery(query);
out.println(P STRONGHotel ---   City/STRONG);
while (rs.next())
{
  String hotelName = rs.getString(1);
  String cityName = rs.getString(2);
  out.println(BR  + hotelName +  ,  + cityName);
}
out.println(/P);
stmt.close();
con.close();
  }
  catch(SQLException ex2)
  {
out.println(SQL Exception  + ex2);
  }
  out.println(/HTML);
  out.println(/BODY);
}
}


***

i believe it's something to do with the postgres driver?

cheers


 From: Brian Adams [EMAIL PROTECTED]
 Reply-To: Tomcat Users List [EMAIL PROTECTED]
 To: 'Tomcat Users List' [EMAIL PROTECTED]
 Subject: RE: JDBC
 Date: Mon, 11 Feb 2002 06:33:35 -0600
 
 what problems are you having?  can you post an error or code or both?
 B
 
 -Original Message-
 From: vinny patel [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 11, 2002 3:48 AM
 To: [EMAIL PROTECTED]
 Subject: JDBC
 
 
 I am having problems with my servlets that connect to a postgres
 database. I am using the Tomcat 4, if anyone has any suggestions, i would
 be
 
 gratefull!
 
 thanks
 
 _
 Join the world's largest e-mail service with MSN Hotmail.
 http://www.hotmail.com
 
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 
 --
 To unsubscribe:   mailto:[EMAIL PROTECTED]
 For additional commands: mailto:[EMAIL PROTECTED]
 Troubles with the list: mailto:[EMAIL PROTECTED]
 


_
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]



_
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]