JDBC to ODBC - JdbcOdbcDriver

Hi;
What am I doing wrong and how should I correct it?
I understand that class "Class" is in package java.lang and J2SDK comes with the JDBC-to-ODBC-bridge database driver to allow any Java program to access any ODBC data source. When I code the following
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")
I get SQLException runtime error:
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified.

check your datasource name... i think you probably
defined it yet....
Yes,
In other words, go to control panel, ODBC data sources (or Administrative Tools), and make sure you have an ODBC connection pointed at your database. Make sure you've spelled the ODBC name correctly in your code.
The code you provide is not where the problem is.

Similar Messages

  • The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded with jws

    Hi,
    When I execute my executable jar file, there is no problem but when I open my .jnlp with web start, I obtain my main frame but the queries don't work.
    I have the error message below :
    Java Web Start 1.2 Console, d�marr�e Fri Apr 25 14:55:59 CEST 2003
    Environnement d'ex�cution Java 2 : version 1.3.1 par Sun Microsystems Inc.
    See com.borland.dx.dataset.DataSetException error code: BASE+83
    com.borland.dx.dataset.DataSetException: The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
         at com.borland.dx.dataset.DataSetException.a(Unknown Source)
         at com.borland.dx.dataset.DataSetException.driverNotLoadedAtRuntime(Unknown Source)
    Anyone can help me please?

    Almost certainly, you need to include the JAR file that contains the class in question as a resource in your JNLP. My personal preference for this kind of thing is to have an entry that actually points to another JNLP for the driver (database, e-mail, whatever you need).
    In general, the whole application has to be packaged so that JWS is aware of all the pieces (other than the JRE)--one other thing I've done in some cases is put the driver JAR's into the jre/lib/ext directory.
    HTH,
    J M Craig

  • Use of sun.jdbc.odbc.JdbcOdbcDriver

    Hi, I'm starting to work with Java and I'm trying to connect to a SQL Server 2000 database using "sun.jdbc.odbc.JdbcOdbcDriver" driver but when I try to make the connection I get this error:
    "java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Cannot get connection"
    Here is the my code:
    final static private String _driver = "sun.jdbc.odbc.JdbcOdbcDriver";
    final static private String _url = "jdbc:odbc:<databasename>";
    Class.forName(_driver);                    // Load Driver
    c = DriverManager.getConnection(_url, "<user>", "<passwd>");
    } catch (java.lang.ClassNotFoundException e){
    System.out.println(e.toString());
    System.out.println("Cannot find driver class");
    System.exit(1);
    } catch (java.sql.SQLException e) {
    System.out.println(e.toString());          
    System.out.println("Cannot get connection");
    System.exit(1);
    Someone can help me with this ?? I'm stuck !!
    Thanks !!

    Hi, I'm starting to work with Java and I'm trying to
    connect to a SQL Server 2000 database using
    "sun.jdbc.odbc.JdbcOdbcDriver" driver but when I try
    to make the connection I get this error:
    "java.sql.SQLException: [Microsoft][ODBC Driver
    Manager] Data source name not found and no default
    driver specified
    Cannot get connection"
    Here is the my code:
    final static private String _driver =
    "sun.jdbc.odbc.JdbcOdbcDriver";
    final static private String _url =
    "jdbc:odbc:<databasename>"; the DSN that you set up for connecting to your database. is it called <databasename>? somehow i doubt it.

  • The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded with I use jws

    Hi,
    I use Java web start and the problem is that java web start can't be loaded the driver.
    Here is my error message :
    See com.borland.dx.dataset.DataSetException error code: BASE+83
    com.borland.dx.dataset.DataSetException: The driver: sun.jdbc.odbc.JdbcOdbcDriver could not be loaded. This could be a problem with the driver itself, or that the driver is not found on the classpath.
    at com.borland.dx.dataset.DataSetException.a(Unknown Source)
    at com.borland.dx.dataset.DataSetException.driverNotLoadedAtRuntime(Unknown Source)
    at ...
    In my .jnlp I put :
    <resources>
    <j2se version="1.3+" />
    <jar href="ManipulationLigneAS400.jar" /> it's my application
    <jar href="classes12.zip" />
    </resources>
    I don't know what .jar I have to put?
    Someone could help me please?

    Hi,
    see your thread http://forum.java.sun.com/thread.jsp?forum=31&thread=385994
    Ulrich

  • Where can i download (free) sun.jdbc.odbc.JdbcOdbcDriver?

    where can i download (free) sun.jdbc.odbc.JdbcOdbcDriver?... could u please give me the downlaod path...thanks...thanks million
    mag

    What if that code indicates you don't have it? i
    keep getting a ClassNotFound error for
    sun.jdbc.odbc.JdbcOdbcDriver. i can't d/l the JDK
    from Sun, i'm on OS X; i have downloaded it from
    Apple. i can't find the class anywhere, nor anywhere
    online. ODBC (not java) requires drivers which are OS specific. So it doesn't matter if you have the JDBC driver if you can't find the ODBC driver for the database that you want.
    i thought i was supposed to be able to code
    Java on OS X just fine?JDBC works. That is part of java.
    Drivers are not part of java. They are separate products.
    I suspect that, for example, if you want to connect to Oracle and you get the type 4 drivers from Oracle that they will work just fine on that OS.
    You might find that for the database that you are using that there is no driver (explicitly) for that OS though.

  • Do I need to download sun.jdbc.odbc.JdbcOdbcDriver ??

    Do I need to download sun.jdbc.odbc.JdbcOdbcDriver ??
    Thank you in advance.

    The JDBC/ODBC bridge comes with the JDK/JRE, at least since 1.2, I don't know about 1.1.
    Col

  • Unable to load jdbc.odbc.JdbcOdbcDriver.

    Hi all,
    The following lines of codes produced error message: "Unable to load class jdbc.odbc.JdbcOdbcDriver":
    import java.sql.*;
    try {
       Class.forName("jdbc.odbc.JdbcOdbcDriver");
       Connection connection = DriverManager.getConnection("DatabaseName", "user", "password");
       PreparedStatement getRecord = connection.prepareStatement("select * from TableName where empNo = ?");
       getRecord.setString(1, empNoValue); // empNoValue is just a string value.
       ResultSet result = getRecord.executeQuery();
       while(result.next()) {
    catch(Exception ex) {
       System.out.println(ex.getMessage());
    }**I thought it had to do with the configuration of my ODBC Data Source but not sure.
    Please help!!!
    Thanks in advance,
    Tom

    Yes, you must make a reference to the database in you
    windows DNS odbc panel (settings - controlpanel -
    odbc32bit....). Also, access doesn't require a user
    and password... unless you made your database this
    way. You can just leave those strings as "". Do you
    have the J2EE extensions?(1) I did make a reference to the database
    (2) I set up a user and password for this db though.
    (3) What do you mean "J2EE" extension? (I guess the answer is No)
    ** Is the problem due to User DNS instead of System DNS. I don't have access to the System DNS. However, this is less likely the case because I've done this before (and on the same system.)

  • What do I need to use sun.jdbc.odbc.jdbcOdbcDriver

    hi there
    what do I need to use sun.jdbc.odbc.jdbcOdbcDriver to access MS Access database?
    String sourceURL = "jdbc:odbc:mysource";
    String sqlQuery = "select ComsumerAccountNumber from EDS5";
    //getting a connection
    try {
    Class.forName(driverName);
    Connection databaseConnection = DriverManager.getConnection(sourceURL);
    Statement statement = databaseConnection.createStatement();
    ResultSet rs = statement.executeQuery(sqlQuery);
    while(rs.next()){
    ...some code to do with the results
    catch (ClassNotFoundException cnfe) {
    System.err.println(cnfe.getMessage());
    catch (SQLException sqle) {
    System.err.println(sqle.getMessage());}
    I got error and caught it in catch( classnotfoundexception). no driver. is this the correct way to use a driver. I have created a data source.

    make sure the driverName is "sun.jdbc.odbc.JdbcOdbcDriver"
    I noticed you typed in your message "sun.jdbc.odbc.jdbcOdbcDriver" with a lowercase 'j'

  • Jdbc to odbc

    I created a db named ClientID with Access first then made a JSP ,the error report say that
    java.sql.SQLException: [Microsoft][ODBC Manager] can't find db and default dbdriver ;
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
         at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
         at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3074)
    >>>>>>>>>>>>
    but when I changed it into application
    it works well.what's wrong ?
    <%@page import="java.sql.*"%>
    <html>
    <BODY>
    <%String strurl="jdbc:odbc:ClientID";
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection(strurl) ;
    Statement stmt=conn.createStatement();
    ResultSet rs=stmt.executeQuery("select * from client");
    %>
    <TABLE bgcolor=DodgerBlue>
    <B>ClientID</B>
    <B>ClientName</B>
    <B>City</B>
    <%
    while(rs.next()){
    %>
    <%=rs.getString("id")%>
    <%=rs.getString("com")%>
    <%=rs.getString("city")%>
    <%
      rs.close();
      stmt.close();
      conn.close();
      %>
      </TABLE>
      </BODY>
      </HTML>
    import java.sql.*;
    public class Access
    public static void main(String args[])
    try
    String strurl="jdbc:odbc:ClientID";
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn=DriverManager.getConnection(strurl) ;
    Statement stmt=conn.createStatement();
    ResultSet rs=stmt.executeQuery("select * from client");
    while(rs.next())
    System.out.println(rs.getString("com"));
    }catch(Exception e)
    System.out.println(e);
    }

    angeles1016 : The JdbcOdbc driver is part of the standard java runtime, and shouldn't need to be imported into web-inf/lib.
    w1o1s1h1:
    You say it works in an application, but not in a jsp page?
    Strange. Maybe the Tomcat user has a different priveleges on the system?
    Make sure your datasource in the control panels is specified as a SYSTEM level DSN, and not USER.
    Another alternative is to define your DSN on the fly:
    String strURL = "jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};DBQ=C:/data/Access/test1.mdb";
    http://forum.java.sun.com/thread.jspa?forumID=48&threadID=200603
    Hope this helps,
    evnafets

  • IBM U2 Universe JDBC or ODBC, Can't connect

    Hi, I can't find a definite answer on the forums, so I will
    post this here. I'm trying to set up a JDBC or ODBC connection to a
    Universe 10.0 database.
    I've been able to setup both the ODBC and JDBC drivers in
    other programs, but coldfusion still isn't working properly.
    The ODBC connection will verify, but when you try to do
    anything, you get the error "invalid argument value" everytime,
    making it useless.
    The JDBC connection has offered more success, but is still
    useless. SELECT statements work 100% and don't give a problem.
    UPDATE, INSERT, or DELETE statements will work and update the
    database, but the .cfm page loads constantly until it hits the
    timeout period and throws an error. It's like the server is not
    responding back from anything but SELECT statements.
    If there is any updates on the status of these problems,
    please let me know, because I can't find any solid solutions on the
    net.

    No, the JdbcOdbc bridge appears to be calling it.
    I'll look for an option; where on earth do I find
    documentation on it?Notice the part where I said noted that it might be obscure or not documented at all?
    The most likely place is to find the source code for the ODBC driver and hope it has documentation. It might also be documented in the source code itself.
    >
    Is it allowed to hack the JdbcOdbc code? I was under
    the impression that accepting the Sun licence limited
    that option. The driver comes with Jdk 1.4. :-$
    Yes, as long as you do not distribute it.

  • Does TT support OCI API except JDBC and ODBC?

    Hi
    Does TT support OCI API except JDBC and ODBC? or Do we have any plan to support OCI in the future

    Oracle policy does not permit us to give any commitment to when or if any specific functionality will be delivered. My understanding is that we plan to deliver this in the next major release of TimesTen (which may or may not be called 8.0) that is released after Oracle 11g (since a lot of the changes needed to enable OCI support for TimesTen are in the 11g client). We currently hope that this release will be available sometime in CY2008.
    You should not rely on any of the above information as it is, as always, subject to change without notice.
    Chris

  • Popularity of JDBC to ODBC or OLEDB

    Does anyone know of any statistics about the market share of database applications that use JDBC VS ODBC VS OLEDB (VS native I guess too). I don't mean for this to be a C VS Java question... but more along the lines of what is the breakdown of what percentages of database applications use to connect to the database.
    - Mark

    Well... I am sure Google could find you plenty of statistics but how helpful they will actually be is another matter altogether.
    I think there are two problems with most statistics you will find. First of all you have to question the source. Like a study sponsored by Sun will say radically different things from a site sponsored by Microsoft. Will either one be the truth. No. It will be "somewhere" in the middle probably.
    Then you have to compare apples to apples as best you can. Your question is way to broad to let that be accomplished. As a guess if I had to guess a the #1 database usage scenario ranked by total number of applications that use it I would guess that the answer is neither JDBC, nor ODBC but the PHP MySQL library.
    Now does that mean PHP is better? Well in most cases no. Except in one case it may be... that case being rapid development of relatively simple websites. Occaisonally I read nonsense about how PHP is better than Java but you just can't make that kind of claim. It's like comparing a compact car to a 747 jet. If you want to visit a town 15 miles down the road yes the compact is better. But if you want to go overseas... not so good.
    Being able to compare apples to apples is not always easy but the less bias the source has the easier it gets. I am reminded of the netcraft site. They collect information on the usage of different web technologies (and I think sell it) so I would say they are pretty unbiased. At any rate I remember seeing some web server stats that basically showed Linux is far and away the champ when it comes to OS's for hosting the most websites. Windows was second and various Unixy flavours after that. Well down the list was Solaris.
    What was interesting though was taking the list of the top 20 or so sites by total traffic. As I recall about 75% of those were on Solaris which was a far different picture than the overall share of less than 5% Okay to be honest I can't remember these numbers for sure but the difference was striking and I would be surprised if I was off by very much and anyway I am just trying to make a point here. The point being that if you asked what is the "best" you get very different answers even from the same set of data depending on how you define best. I think it also makes a strong case that to use volume as an indicator of "bestness" is poor idea.
    At any rate I suppose one could find some statistics on JSP vs ASP usage but what that actually tells you I don't know. Let's not forget that they are many, many, many applications running in enterprises around the globe that are not web based so an accounting for these is even harder.
    Here is what I would suggest. Try and define better parameters for your question. I would try and look segment by segment of what the application is. Even a breakdown just by web vs non-web would be a good start. Then I would also look to examine the usage by the scale of the application. You need to seperate the little foxpro based VB apps that might sit on someones desk from an enterprise inventory and tracking system. I mean they both use databases but the usage cases are so different... well anyway I'm sure you see the point.
    So get some better parameters for your question... otherwise it will be difficult to find data I think (especially that which is both web and non -web together) plus any data you do find will be relatively meaningless.
    Hope this helps.

  • How can i put a file into blob(using sun.jdbc.odbc.JdbcOdbcDriver)

    Hi
    i tried to put a file into blob , but got a problem.....
    My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver )
    a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~)
    //Statement stmt2=null;
    //Resultset rs2;
    //opa1 is the blob data
    void saveBlobTableToDisk(Connection con) {
    try {
    stmt2=con.createStatement();
    sqlStr2="SELECT * FROM emp3 where id=1004";
    rs2=stmt2.executeQuery(sqlStr2);
    while (rs2.next()) {
    Blob aBlob=rs2.getBlob("opa1");
    i got the exception :
    " null
    java.lang.UnsupportedOperationException
         at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4174)
         at test3.Frame1.saveBlobTableToDisk(Frame1.java:48)
         at test3.Frame1.<init>(Frame1.java:26)
         at test3.Application1.<init>(Application1.java:5)
         at test3.Application1.main(Application1.java:8) "
    and the windows pop up a messagebox said that(about) my memory "0x09af007f" could not read, error in javaw.exe .
    Later i used (ResultSet)getBinaryStream() to solve it. but getBinaryStream() only return a InputStream,so that i can make blob to a file,but i can't make a file to blob using jdbc.....
    I am very stupid that installing sun java, oracle jdbc driver etc....(because i must set a lot of thing such as classpath,java_home etc), Can i only use JBuilder to do that ?
    Or i must install oracle jdbc driver ?
    Thanks.

    My guess here is that Sun's JDBC-ODBC bridge doesn't handle the BLOB datatype. Most ODBC drivers don't support that datatype, so I wouldn't expect the bridge to.
    Is there a reason that you can't use the Oracle driver?
    Justin

  • Installing sun.jdbc.odbc.JdbcOdbcDriver

    Hi, how do you install this driver?

    a DSN is a database source name correct? How do you
    make a System DSN? I think this might solve the
    problem as i found someone else with the same problem
    with me and after someone suggested that there was no
    response.No.
    DSN is a Data Source Name.
    A data source is an ODBC construct that includes the path etc. to the database in question.
    What you are putting in is just the name of the database which is not the same at all.
    If you don't want or don't know how to set up a DSN you can use what is called a dynamic DSN in which you specify the database.
    Look at the first reply in this thread.
    http://forum.java.sun.com/thread.jspa?forumID=48&threadID=440387

  • Crystal Reports 2008, mySQL, JDBC, and ODBC

    Hello everyone.
    I have just spent a very challenging few days getting Crystal Reports 2008 Developer (advanced version) working with a mySQL data source.  I fell into several pits and narrowly escaped being eaten by monsters. I thought I'd share my experience to spare others the same trouble.  All the stuff I'm writing about here applies to the runtime as well as the Developer UI.
    I'm working on Windows Server 2008 R2, 64 bit, standard edition.  The mySQL server is 5.1.42. The mySQL ODBC connector is version 5.1.6.  You need the 32-bit version of this connector, even if you're on a 64-bit machine.
    Lessons learned:
    1. JDBC connectivity in Crystal Reports doesn't work correctly.  It consumes excessive memory when a report  requires lots of rows from a data base.  Don't even think about using it.
    2. Crystal Reports has a problem with ODBC for mySQL in which it sometimes gives a dialog box with these words in it.
    The alias requested 'SOME_TABLE_NAME', contains a combination
       of characters which is not considered to be valid.
    This error message come up when using items on Crystal's "Database" menu like "Set Datasource Location..."
    To fix this you need to make a registry change.  As far as I know this has to be done for each account on each machine running the Crystal Developer. (insert usual warning about registry editor). Find the key named:
    [HKEY_CURRENT_USER\Software\Business Objects\Suite 12.0\Crystal Reports\Database
    Create a new string value named InvalidAliasCharList Give it this value:
    .:{}()@&$#^!*~|%\\\"
    Notice that the last two characters are backslash double-quote.
    Good luck.  It actually works pretty well now that it's working.
    If any other community member can offer corrections or better ways of coping with this stuff, please do!

    Good morning,
    I was wondering if I may ask some additional help...
    We're on version 14.0.4.738 RTM and we are having the same issue.... need to enter the alias as table name with a backslash, ie serparate_work_orders\ for login credential reasons, but all the regedits listed seem to refer to locations in the registry that dont exist.
    Version 14 have two "database locations" from what i can see called...
    HKEY_CURRENT_USER\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseOptions
    and
    HKEY_CURRENT_USER\Software\SAP BusinessObjects\Suite XI 4.0\Crystal Reports\DatabaseServer
    I've applied the patch to both these locations and still no joy, same error message!
    Any ideas?

Maybe you are looking for

  • HP LaserJet Pro CM1415fn Color Multifunction Printer

    Hi all we have HP LaserJet Pro CM1415fn Color Multifunction Printer when I try to Scan it show the page scaning but as soon as the scan complite it gone it display nothing  0 page of 0 . http://s30.postimg.org/e3sakkg81/Scan1.jpg http://s28.postimg.o

  • How to find out what t-code(s) a user executes most?

    Can anybody tell me how I can find out what transaction(s) a given user executes most from the all the transactions that given user has access to? For example if a user has access to 100 t-codes, but only uses 10 of them then, how can I find out that

  • Blackberry bold 2 (9700) as a modem for Powerbook 15"

    Some times in an emergency without hot spots I´ll need to use my bold 2 as  a modem to have internet. I follow all instructions by the mexican carrier (Telcel-America movil) but I can´t get internet connection.

  • Trouble installing Windows 7, 64bit

    Hello, I have a Macbook Pro, 15 in. and I have the model that will allow for the 64 bit version. This is my first time using Bootcamp, so I don't have any version of XP already installed. I've used the bootcamp installer, and everything goes fine exc

  • Workitems not getting approved in SRM

    We have shopping cart created  but even after approving the item by the approving manager - shopping cart still shows in Awaiting Approval status and a new line ite gets created under the main item. No PO gets generated. All workflow related settings