generally  for db  conns.. u have to use like ths..

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conn;
// <if ur DSN name is "Test"> if it's goin to b ur sQl, userid = sa,password
(byd default)="" >
conn = DriverManager.getConnection
("jdbc:odbc:Test,<userid>,<password>");




----- Original Message -----
From: "Kyle Burke" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, February 28, 2001 8:00 AM
Subject: Re: JBDC/OBDC driver loading problem.


> 1.  You have a database user without a username or a password?  Did you
mean
> to use the dbo user?  Because that's "sa","".
>
> 2.  In the description for a dsn you may have the " " but in the name that
> you refer to to DSN with may not.
>
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Thang Nguyen
> Sent: Tuesday, February 27, 2001 2:26 PM
> To: [EMAIL PROTECTED]
> Subject: JBDC/OBDC driver loading problem.
>
>
> Hi,
>
> I am currently using Tomcat4.0 and jdk1.3 and my system is Windows
> 2000.     I setup everything and it works fine.   However,  when I try
> to run one of my servlets (a servlet that will connect to odbc
> database).  Pls take a look at
> my CLASSPATH and servelt, let me know if I am missing something.  Thanks
> much.
>
>
> I got the error complaining about the driver which is "SQLException
> caught: No suitable driver"
>
> Here is my CLASSPATH:
> CLASSPATH= C:\tomcat4.0\jakarta-tomcat-4.0\bin\servlet.jar;
> C:\jdk1.3\jre\lib\rt.jar
>
>
> And here is my java code:
>
>
> /*
> VideoSelectServlet
> */
>
> import java.io.*;
> import java.sql.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> /**
>  * This is a simple example of an HTTP Servlet.  It responds to the GET
>  * method of the HTTP protocol.
>  **/
> public class VideoSelectServlet extends HttpServlet {
>
>     public void doGet (HttpServletRequest request,
>                        HttpServletResponse response)
>         throws ServletException, IOException
>     {
>         Connection con = null;
>         Statement stmt = null;
>         ResultSet rs   = null;
>
>         try {
>            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
>            String url = "jdbc.odbc.Movie Catalog";
>            con = DriverManager.getConnection (url, "", "");
>            System.out.println("Testpoint");
>         }
>         catch (ClassNotFoundException e) {
>            System.out.println("SQLException caught: " + e.getMessage());
>
>         }
>         catch (SQLException e) {
>            System.out.println("SQLException caught: " + e.getMessage());
>
>         }
>         finally {
>           try {
>              if (con != null) con.close();
>           }
>           catch (SQLException ignored) {}
>         }
>     }
>
>     public String getServletInfo() {
>         return "The BookDetail servlet returns information about" +
>                "any book that is available from the bookstore.";
>     }
> }
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to