If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > apache tomcat oracle 10 g connection problem...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-07, 09:55
balu0072005 balu0072005 is offline
Registered User
 
Join Date: Nov 2007
Posts: 2
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
Reply With Quote
  #2 (permalink)  
Old 11-07-07, 10:31
amthomas amthomas is offline
Registered User
 
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
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On