Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 17th, 2006, 05:15 AM
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Database connection error help me

I am a newbee in jsp development. I am using Oracle JDeveloper 10g as a JSP editor.
i made following code to connect with the database.
<%@ page import="java.sql.*" %>
<%@ page language="java" %>
<%@ page import="mypackage.*" %>
<HTML>
 <HEAD><TITLE>Man Get Connected </TITLE></HEAD>
 <BODY>
 <%

  DataAccess daccess=new DateAccess();

  Connection conn = null;
  Statement st = null;
  ResultSet rs = null;
  try {

    try{Class.forName("com.mysql.jdbc.Driver").newInst ance();
    }catch(Exception ex)
    {out.println("Driver not found");
    }

      try{conn = DriverManager.getConnection("jdbc:mysql://localhost/menageris?user=root&password=teralight");
      }catch(Exception ex)
       {
        out.println("Driver Manager not Connected");
        }
          st = conn.createStatement();
          rs = st.executeQuery("select * from company");
        while(rs.next())
       {
    %>
    <%= rs.getString("name") %><br>
    <%
        }
    }
    catch(Exception ex) {

    out.println("connection not found");

    }
    %>
</BODY>
</HTML>

And found exception as:
----->>>>>>>> Driver not found
plz help me in dealing with that
have I made any change in JDeveloper,path setting etc

 
Old March 21st, 2006, 08:38 AM
Authorized User
 
Join Date: Mar 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Copy the following file into the web/application server's lib directory.

mysql-connector-java-3.0.15-ga-bin.jar






Similar Threads
Thread Thread Starter Forum Replies Last Post
Database connection error......Page not loading??? ankur_icfai ASP.NET 2.0 Basics 2 January 25th, 2007 09:12 AM
Database connection error lappling General .NET 0 April 20th, 2006 07:48 AM
Database Connection Error werD420 Classic ASP Databases 12 January 20th, 2005 01:52 PM
Server error for database connection frankv25 ASP.NET 1.0 and 1.1 Basics 5 August 14th, 2004 07:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.