Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases 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 26th, 2004, 12:34 PM
Registered User
 
Join Date: Feb 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem in connecting jdbc and sql

when i tried to run my first sql - jsp application i got this error message :
HTTP Status 500 -

---------------------
type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
    org.apache.jasper.runtime.PageContextImpl.doHandle PageException(PageContextImpl.java:867)
    org.apache.jasper.runtime.PageContextImpl.handlePa geException(PageContextImpl.java:800)
    org.apache.jsp.bookDB_jsp._jspService(bookDB_jsp.j ava:87)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:133)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:311)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:301)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:248)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:856)
 CAN ANYBODY TELL ME HOW TO SOLVE THIS PROBLEM?
THX
 
Old March 28th, 2004, 07:19 PM
Registered User
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,


In order for anybody to help you , you should first submit your code
and them explain the steps you've taken to get your code up. For ex what driver you've used . The errors are more likely unsuitable driver or improper compiling of codes

Judex

 
Old April 6th, 2004, 02:20 PM
Registered User
 
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since you're running a servlet make sure you:

1) Have a valid driver for the database
2) Have placed it in the WEB-INF/lib directory of your application (if it's an archive) or in your WEB-INF/classes directory (if it's a single class or extracted from an archive)
3) If the driver class is in your classes directory structure, remember that it must be placed in a directory structure that corresponds to the package statement of the class
4) Have imported the driver's package for your implementing class
5) Depending on your application server, you may need to change .zip extensions to .jar if you are using an archive
6) Properly load the driver (I use Class.forName())
7) Make sure the driver is registered with the DriverManager
8) Make sure your database is up and running
9) Double-check your connection URL, including the port #

These are standard steps no matter what you're trying to do, and they're the only advice we'll be able to give without a code snippet.

Let us know if you get things working, or post some code to help us help you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem connecting to sql server rajanikrishna ASP.NET 2.0 Basics 1 September 5th, 2007 04:47 PM
Problem connecting to SQL Express after publishing bleitner SQL Server 2005 2 January 9th, 2006 01:52 AM
problem 2 connecting SQL Server 200 using ASP.NET nagen111 ADO.NET 5 February 16th, 2005 01:26 AM
Exception connecting to Oracle Database with JDBC celia05es Java Databases 1 March 31st, 2004 04:42 AM
I have problem connecting to SQL Server 2000 sp3 ctanchan SQL Server 2000 0 September 11th, 2003 07:35 PM





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