Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2007
    Posts
    2

    Unanswered: apache tomcat oracle 10 g connection problem...

    after starting tomcat, after calling the DisplayAllEmployees.jsp from webbrowser, i am getting NULL POINTER EXCEPTION in web browser and
    the below error in tomcat server :--
    -------------------------------------------------------

    Getting Connection.............
    Error : java.sql.SQLException : [Microsoft ] [ ODBC Driver Manager ] Data source name not found and no default driver specified

    -------------------------------------------------------
    i am using oracle 10 g

    i am using the below MyConnection.class
    ---------------------------
    // MyConnection.java
    //
    // placed as
    // K:\tomcat\webapps\test\WEB-INF\classes\mycon\MyConnection.java


    package mycon;

    import java.sql.*;

    public class MyConnection
    {
    Connection connection;

    public MyConnection()
    {
    connection = null;
    }

    public Connection getConnection()
    {
    openConnection();
    return connection;
    }

    private void openConnection()
    {
    try
    {
    boolean isReady = true;

    if(connection == null)
    {
    isReady = false;
    }
    else if(connection.isClosed() == true)
    {
    isReady = false;
    }

    if(isReady == false)
    {
    // Connection not in open mode, open the connection now

    System.out.print("Getting Connection ... ");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

    connection = DriverManager.getConnection(
    "jdbcdbc:javaoracle","system","bhaskar");

    System.out.println(" OK");
    }

    }
    catch(Exception ex)
    {
    System.out.println();
    System.out.println("Error: "+ex);
    }
    } // end of openConnection()
    } // end of class

  2. #2
    Join Date
    May 2005
    Location
    San Antonio, Texas
    Posts
    134
    Is the DSN set up correctly and working for the ODBC connection?

    I believe it is saying that it can't find the data source name that the connection is referring to.
    Vi veri veniversum vivus vici
    By the power of truth, I, a living man, have conquered the universe

Posting Permissions

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