CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Guest

    Servlet: Problem connecting database

    I am trying to connect to database using JdbcOdbc driver in the init mathod of a Servlet. I have tested the connection writting a test java code. Connection is ok. But while executing Servlet it gives error:

    SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    ===================================

    con = DriverManager.getConnection"jdbcdbc:MPRDB","tstmgr", "pass");

    ==================================

    Help me

    -Kaushik



  2. #2
    Join Date
    May 1999
    Location
    USA
    Posts
    27

    Re: Servlet: Problem connecting database

    Can you post the sequence of exceptions? (the chain of nested exceptions traced up to your function call).
    The immediate thing that I can think of is, check your DSN to make sure if it is okay. However, since you say you tried a test program and it works, it is unlikely to have any problem with data source.
    -Amaresh


  3. #3
    Guest

    Re: Servlet: Problem connecting database

    Hi!
    I am also facing the same problem. I think it is due to configuration. I am using IIS Web Server , JRUN engine. If your problem
    is solved? can you please let me know also. It will be realy helpfull for me. sice i am trying this for past two days.

    Regards
    Sami

    [email protected]


  4. #4
    Guest

    Re: Servlet: Problem connecting database

    In "con = DriverManager.getConnection"jdbcdbc:MPRDB","tstmgr", "pass");"
    Put a parenthesis after getConnection. It must have have been a typo but just in case....
    Which database are you connecting to ? If you connect to MS Access, say, then you will have to create a profile in the ODBC datasource on the server where you are keeping the servlet.(I presume you are using a NT Server) Did you create a profile for MPRDB ?
    Give the exact piece of code that you are using to connect to the database (class.forName(..), con = DriverManager.get...) and the exception messages.






Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured