p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Java > Other Java > Java Databases
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 23rd, 2005, 08:05 AM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default java.sql.SQLException: [Microsoft][ODBC Driver Man

Hi i am getting the following

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

while executing the folloing program. I am using
Apache Tomcat 5.0.19 webserver & sel server as database.

Please Help me.
Thanks in advance.


import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;

public class TomacatData extends HttpServlet{
    Connection con=null;
    Statement st=null;
    ResultSet rs=null;
    String qry=null;
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException{
        PrintWriter out=res.getWriter();
      out.println("Hi hari");

    try{
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
             con = DriverManager.getConnection("jdbc:odbc:exonweb");
             st=con.createStatement();
             qry="SELECT cmpny_sCmpShortName, cmpny_sCmpName FROM CMPNY where cmpny_sCmpName like 'E%'";
             rs=st.executeQuery(qry);
             while(rs.next()){
                 System.out.println(""+ rs.getString(1));
                 System.out.println(""+ rs.getString(2));
            }
         }catch(SQLException e){
            System.out.println("Error in getConnection:"+e);
              }catch(ClassNotFoundException e){
                  e.printStackTrace();
              }
    }

}


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old May 5th, 2005, 03:40 AM
Friend of Wrox
Points: 726, Level: 10
Points: 726, Level: 10 Points: 726, Level: 10 Points: 726, Level: 10
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , India.
Posts: 345
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to gokul_blr Send a message via Yahoo to gokul_blr
Default

check whether ODBC driver jar file into web-inf lib folder


Gokulan Ethiraj
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Microsoft][ODBC SQL Server Driver] TIME OUT ERROR rtr1900 ASP.NET 2.0 Basics 1 November 12th, 2008 09:36 AM
[Microsoft][ODBC SQL Driver]Connection is busy muthumari_p2003@yahoo.com Pro JSP 0 May 8th, 2006 08:51 AM
SQLException in using odbc excel driver lironnezers Java Databases 0 March 5th, 2006 05:18 AM
[Microsoft][ODBC Microsoft Access Driver] Syntax e chinedu Classic ASP Databases 3 November 18th, 2004 03:48 PM
java.sql.SQLException: Error loading JDBC Driver jdphjp Java Databases 1 August 5th, 2004 01:46 AM



All times are GMT -4. The time now is 05:04 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc