Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 24th, 2004, 10:22 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Can't get connection to MS Access

I'm new to JSP and trying to use MS Access (2002) form a Tomcat server (5.0.25). I'm using Windows XP.

The problem is, that the method getConnection on the class DriverManager fails with the error message:

"The Data Source wasn't found, and there is no standard driver"

Here is the line:

con = DriverManager.getConnection("jdbc:odbc:DbMedlem", "", "");

I have created an ODBC data source (DbMedlem) in the XP Control Panel, and it works all rigth.


Can anybody please help??????


Here is the relevant code:

<%
    Connection con; // forbindelse til database
    Statement stmt; // sql-sætning
    String sqlStreng;

    try { // Load jdbc-odbc-driver
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    } catch (ClassNotFoundException e)
    {System.err.println("ClassNotFoundException: " + e.getMessage());}


    sqlStreng = "INSERT INTO Medlem(Navn,Adresse,Postnr,Telefonnr,Email,Medlems type,Boldkanon,Nøgle,Kommentar) ";
    sqlStreng += "VALUES('aa','aa',5000,'aa','aa','aa','aa','aa','a a')";

    con = null;
    try {
        con = DriverManager.getConnection("jdbc:odbc:DbMedlem", "", "");
        stmt = con.createStatement();
        postnrInt = stmt.executeUpdate(sqlStreng);
        stmt.close();
        con.close();
    }
      catch(SQLException e)
       {sqlStreng = e.getMessage();}

%>



Reply With Quote
  #2 (permalink)  
Old June 1st, 2004, 04:54 AM
Authorized User
 
Join Date: Feb 2004
Location: Jilin, Jilin, China.
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to cash
Default

please check you odbc data source and make you data source name(DbMedlem) was the only one and the name was right.

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection String to MS ACCESS jmss66 Classic ASP Databases 4 January 24th, 2008 06:54 PM
MS Access to SQL server connection imaley Access VBA 3 February 16th, 2007 01:59 PM
Connection Pool on MS Access? Edward King Java Databases 1 August 3rd, 2005 12:48 AM
ms access database connection android66 Javascript 1 December 1st, 2004 07:19 AM
Help with ASP and MS ACCESS. Connection error. patzblue Access ASP 7 September 11th, 2004 05:43 AM



All times are GMT -4. The time now is 03:19 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.