is that one method really named "deGet" ?? -----Original Message----- From: Bo Wang [mailto:bowang3@home.com] Sent: Tuesday, April 17, 2001 8:15 PM To: tomcat-user@jakarta.apache.org Subject: Re: JDBC question Thanks for your help, here attached my servlet. I'm using win98 with Access 97, and set up a system DSN "Northwind" without userID and password. After I run this servlet, I got NullPointException. import java.io.*; import java.sql.*; import javax.servlet.*; import javax.servlet.http.*; public class JDBCServlet extends HttpServlet { Connection dbConn; public void init ( ServletConfig config ) throws ServletException { super.init( config ); try { Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" ); dbConn = DriverManager.getConnection( "jdbc:odbc:Northwind" ); } catch ( ClassNotFoundException e ) { System.out.println( "*****JDBC-ODBC bridge not found" ); return; } catch ( SQLException e ) { System.out.println( "*****SQL exception thrown in init" ); return; } } public void deGet( HttpServletRequest req, HttpServletResponse resp ) throws ServletException, IOException { try { resp.setContentType( "text/html" ); PrintWriter out = resp.getWriter(); Statement stat = dbConn.createStatement(); ResultSet customers = stat.executeQuery( "select CustomerID, CompanyName, City, Country from " + "Customers" ); out.println( "" ); out.println( "Customer List" ); out.println( "" ); out.println( "

Customer List

" ); out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); while ( customers.next() ) { out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); out.println( "" ); } out.println( "
Customer IDCompany NameCityCountry
" + customers.getString( "CustomerID" ) + "" + customers.getString( "CompanyName" ) + "" + customers.getString( "City" ) + "" + customers.getString( "Country" ) + "
" ); out.println( "" ); customers.close(); stat.close(); dbConn.close(); } catch ( Exception e ) { e.printStackTrace(); } } } ----- Original Message ----- From: "RameshBabu R Muthuvel" To: Sent: Tuesday, April 17, 2001 12:25 PM Subject: Re: JDBC question > Hi > There are numerous issues. > > Some are: > 1) either ur dsn is not there > 2) Your tables datatype doesn't match with the value passed or accessed from > servlet etc........... > > send ur servlet, to find out what really happens > > ramesh > > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > >