Automatic jdbc odbc connection

we have an application that uses an access database. normally we have to go to control panel, go to the DataSources and manually setup the odbc connection. after this, our program connects to the database and works as planned. what we want to do is to automatically connect the database, like having an executable file that automatically installs a software. is there any way that would connect the database to the computer without manually performing all those tasks?

Use some other jdbc driver than jdbc-odbc driver. to find the driver list visit
http://industry.java.sun.com/products/jdbc/drivers

Similar Messages

  • JDBC-ODBC Connection

    Both my office and home computers are installed with Win 2000, Java 2 SDK SE 1.4.1_01, and Tomcat 4.1. Then how come I can connect to the database and run JSP with the office computer, but I can't even connect to the database with the home computer? I tried the JDBC:ODBC:(ODBC Name here) and the home computer pops up an "unidentified error" message.
    * How can I check if my computer is installed with the JDBC-ODBC bridge driver?
    * Is there a serarate download file for that? I understand it automatically comes with Java 2 SDK, but I don't see how it's working. I uninstalled and reinstalled Java 2 SDK many times, but all the same.
    * Is there any other way to connect to the database and run JSP without using the JDBC:ODBC thing?
    Y.C.

    Using MS Access. Both my office and home computers are running with ASP on IIS and ColdFusion on ColdFusion server. I connect to either MS Access or MS SQL. I've tested ODBC and know it's working though I usually connect through OLEDB. As you may have already guessed, I am new to JSP. My big question at this moment is why JSP to MS Access through ODBC is working in my office but not at home when both computers are almost clone to each other in the same working environment. What else would be the factor in difference than those I told in my previous message?
    This is a part of the connection coding that worked in the office but not at home:
    String MM_connCareerSE_access_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    String MM_connCareerSE_access_USERNAME = "";
    String MM_connCareerSE_access_PASSWORD = "";
    String MM_connCareerSE_access_STRING = "jdbc:odbc:CareerSE";
    What other information would you need?
    By the way, how do you connect to MS SQL with JSP?
    Y.C.

  • Problem in building JDBC ODBC connection with my stand alone Project.

    Hello Everyone!
    I gave the following command in order to create JAR file:
    C:\app>jar cvfm MyJar.jar Manifest.txt .
    and the Manifest file contains the code: Main - Class: Login
    My Manifest File and the .class codes and the JAR file which is created successfully by the above command are in the same folder "app" and then I run the project both at command prompt by the command : C:\app>java -jar MyJar.jar
    and by double clicking the JAR file. My project is running successfully but, I am using JDBC - ODBC Driver in my project and I want to let this project run in any other computer system. So, any other user who is unknown to the Driver used and Database used in my project can't be able to run my project if the specified driver is not installed in his machine and also there is a bridge of ODBC Data Source (from control panel-- Administrative Tools-- Data Sources(ODBC) )from which Driver is selected and the Database is specified.
    In order to test my application, I had removed the data source name from the Control Panel's Data Sources (ODBC) properties' window. Then I run my project then the following error msg is shown in command prompt:
    C:\app>java -jar MyJar.jar
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)
    at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7036)
    at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3028)
    at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:3
    23)
    at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
    at java.sql.DriverManager.getConnection(DriverManager.java:512)
    at java.sql.DriverManager.getConnection(DriverManager.java:193)
    at Login.<init>(Login.java:37)
    at Login.main(Login.java:364)
    Error Trace in getConnection() : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    So, I have a doubt at this point that how a user is able to configure this bridge in order to run my application who is unknown to my project's back-hand? As JRE is essential to run my project so, I have decided to give setup of JRE with my project's CD, may the JDBC - ODBC Driver providing to the user with my application setup solve this problem ?
    Please help me to solve my problem.

    M.V.Asolkar wrote:
    Please please help me.Lets presume hypothetically that the jTDS driver won't work with 2000. It might or might not.
    However the fact remains that your ODBC driver is not working.
    So the first step is to stop trying to run your full application. Instead you create a very simple console application that does nothing but connect to the database.
    Problems that usually occur from that would be.
    1. The connection string is not correct for MS SQL Server.
    2. The connection information for the database is not correct
    3. The database (nothing to do with java) is not configured to accept connections.

  • JDBC-ODBC connectivity from JSP page

    hi
    i am trying to connect a jsp page with database using jdbc-odbc driver. i have created a dsn with the name 'test' that connects to a database 'test' in SQL server. the following lines has been added to the web.xml file placed in the \WEB-INF folder
    <context-param>
    <param-name>
    javax.servlet.jsp.jstl.sql.dataSource
    </param-name>
    <param-value>
    jdbc:odbc:text, sun.jdbc.odbc.JdbcOdbcDriver
    </context-param>
    i have also placed the rt.jar file in the \WEB-INF\lib folder. but, when i run the jsp page and ty to make any database interaction, an expection occurs
    java.lang.ClassNotFoundException : sun.jdbc.odbc.JdbcOdbcDriver
    please help

    I think you need to download the JDBC/ODBC driver jar file into your project. For example, if you need a JDBC driver for the Oracle database, you search google for 'oracle jdbc driver'. Its driver is something like classes14.jar. I suggest you create and test your database connection pool in a servlet so you will have an easier time debugging any issues in getting it to work.
    Also, as the previous post points out, JSP is for displaying data and submitting user input back to the servlet. Put all your business logic in the servlet, put any data you get from the database in request scope by the servlet, dispatch to the JSP page so it can be displayed. This is a crude example. For a better design read up on MVC (Model View Controller) design.

  • Jdbc-odbc connectivity problem in[b] wsad5.1.2[/b]

    while i Try to access the msaccess database using sun.jdbc.odbc.JdbcOdbcDriver,the server is giving the error class not found....sun.jdbc.odbc.JdbcOdbcDriver......
    I have already rt.jar containing this class in my jre...
    The same thing i tried in wsad5.0 and it is working abs fine....
    If anyone has got a time to solve tis query plz help me out...
    Its urgent......

    well,i think nobody has interest in my question.I have asked two questions.
    1)Can anybody tell me the compatibilities of JDBC-ODBC bridge versions,oracle and ODBC drivers?
    2)And can u tell me how to connect to oracle through a pure Java JDBC drivers (type 4 drivers) on a standalone system?
    But u advise me not to use JDBC-ODBC bridge without studying the other part.

  • JDBC-ODBC connectivity problem

    hi ,i have a j2se 1.4.2 version installed on windows 2000 professional.i have j2me wireless toolkit 2.0,Oracle 8i(8.1.5),tomcat 4.0 running on system.I have tried to connect to the database in Oracle through JDBC-ODBC bridge but it becomes non-responsive.The same has been working well with Oracle 9i versions and also in Oracle 8i when ODBC driver is selected as Microsoft ODBC drivers for Oracle but not with Oracle drivers for Oracle.Can anybody tell me the compatibilities of JDBC-ODBC bridge versions,oracle and ODBC drivers? And can u tell me how to connect to oracle through a pure Java JDBC drivers on a standalone system?

    well,i think nobody has interest in my question.I have asked two questions.
    1)Can anybody tell me the compatibilities of JDBC-ODBC bridge versions,oracle and ODBC drivers?
    2)And can u tell me how to connect to oracle through a pure Java JDBC drivers (type 4 drivers) on a standalone system?
    But u advise me not to use JDBC-ODBC bridge without studying the other part.

  • Problem with JDBC ODBC connectivity

    I am trying to connect to MS access database with jsp page. This is sample from my js page :
    String SUN_DRIVER = "sun.jdbc.odbc.JdbcOdbcDriver";
    Class.forName(SUN_DRIVER);
    String aDataSourceName = "puneet";
    String url = "jdbc:odbc:" + aDataSourceName;
    Connection con;
    con = DriverManager.getConnection("jdbc:odbc:puneet","","");
    The last line gives me the follwoing error :
    [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    puneet is name of my datasource and it points to my .mbd file.
    I dont have anyusername or passwords for this daatsource.
    I am using Tomcat/4.1.18-LE and jdk1.4
    I have also added rt.jar in the classpath
    pls help
    pg4

    Hi pg4,
    May be your dsn is not pointing to .mdb file. Check it by putting your mdb file right where your code is and then user following syntax which is called dsn-less connection. It helps you to connect to the target mdb file with out any need of dsn.
    String url = "jdbc:odbc:;Driver={Microsoft Access Driver (*.mdb)}; DBQ=yourDBFile.mdb";
    regards,
    Humayun

  • Help me about jdbc odbc connection

    Can somebody help me ? I have no idea of this error .
    3x
    the error code is :
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x7C941010
    Function=RtlEnterCriticalSection+0xB
    Library=C:\WINDOWS\system32\ntdll.dll
    Current Java thread:
         at sun.jdbc.odbc.JdbcOdbc.allocConnect(Native Method)
         at sun.jdbc.odbc.JdbcOdbc.SQLAllocConnect(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcDriver.allocConnection(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
         at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
         at java.sql.DriverManager.getConnection(Unknown Source)
    Dynamic libraries:
    0x00400000 - 0x0040B000      C:\WINDOWS\system32\java.exe
    0x7C940000 - 0x7C9DD000      C:\WINDOWS\system32\ntdll.dll
    0x7C800000 - 0x7C931000      C:\WINDOWS\system32\kernel32.dll
    0x77D80000 - 0x77E29000      C:\WINDOWS\system32\ADVAPI32.dll
    0x77E30000 - 0x77EC1000      C:\WINDOWS\system32\RPCRT4.dll
    0x77BC0000 - 0x77C18000      C:\WINDOWS\system32\MSVCRT.dll
    0x08000000 - 0x08139000      C:\Program Files\Java\j2re1.4.2_05\bin\client\jvm.dll
    0x77CF0000 - 0x77D7F000      C:\WINDOWS\system32\USER32.dll
    0x77ED0000 - 0x77F16000      C:\WINDOWS\system32\GDI32.dll
    0x76AF0000 - 0x76B1B000      C:\WINDOWS\system32\WINMM.dll
    0x762E0000 - 0x762FD000      C:\WINDOWS\system32\IMM32.DLL
    0x60740000 - 0x60749000      C:\WINDOWS\system32\LPK.DLL
    0x73F80000 - 0x73FEB000      C:\WINDOWS\system32\USP10.dll
    0x10000000 - 0x10007000      C:\Program Files\Java\j2re1.4.2_05\bin\hpi.dll
    0x008A0000 - 0x008AE000      C:\Program Files\Java\j2re1.4.2_05\bin\verify.dll
    0x008B0000 - 0x008C9000      C:\Program Files\Java\j2re1.4.2_05\bin\java.dll
    0x008D0000 - 0x008DD000      C:\Program Files\Java\j2re1.4.2_05\bin\zip.dll
    0x02EC0000 - 0x02ECC000      C:\Program Files\Java\j2re1.4.2_05\bin\JdbcOdbc.dll
    0x73520000 - 0x7355D000      C:\WINDOWS\system32\ODBC32.dll
    0x5AB60000 - 0x5ABF7000      C:\WINDOWS\system32\COMCTL32.dll
    0x77380000 - 0x77B7D000      C:\WINDOWS\system32\SHELL32.dll
    0x77F20000 - 0x77F96000      C:\WINDOWS\system32\SHLWAPI.dll
    0x76300000 - 0x76348000      C:\WINDOWS\system32\comdlg32.dll
    0x77160000 - 0x77262000      C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll
    0x20000000 - 0x20017000      C:\WINDOWS\system32\odbcint.dll
    0x76970000 - 0x76AAC000      C:\WINDOWS\system32\ole32.dll
    0x4D310000 - 0x4D32B000      C:\WINDOWS\system32\odbccp32.dll
    0x77BB0000 - 0x77BB8000      C:\WINDOWS\system32\VERSION.dll
    0x77FA0000 - 0x77FB1000      C:\WINDOWS\system32\Secur32.dll
    0x770D0000 - 0x7715C000      C:\WINDOWS\system32\OLEAUT32.dll
    0x76F80000 - 0x76FFF000      C:\WINDOWS\system32\CLBCATQ.DLL
    0x77000000 - 0x770AB000      C:\WINDOWS\system32\COMRes.dll
    0x0F9A0000 - 0x0F9AB000      C:\WINDOWS\system32\VBAJET32.DLL
    0x58730000 - 0x58768000      C:\WINDOWS\system32\uxtheme.dll
    0x02EE0000 - 0x02EEF000      C:\Program Files\Java\j2re1.4.2_05\bin\net.dll
    0x719E0000 - 0x719F7000      C:\WINDOWS\system32\WS2_32.dll
    0x719D0000 - 0x719D8000      C:\WINDOWS\system32\WS2HELP.dll
    0x43000000 - 0x43005000      C:\Program Files\Google\Google Desktop Search\GoogleDesktopNetwork1.dll
    0x71980000 - 0x719BF000      C:\WINDOWS\system32\mswsock.dll
    0x607C0000 - 0x60816000      C:\WINDOWS\system32\hnetcfg.dll
    0x719C0000 - 0x719C8000      C:\WINDOWS\System32\wshtcpip.dll
    0x76C40000 - 0x76C68000      C:\WINDOWS\system32\imagehlp.dll
    0x67930000 - 0x679D1000      C:\WINDOWS\system32\DBGHELP.dll
    0x76BA0000 - 0x76BAB000      C:\WINDOWS\system32\PSAPI.DLL
    Heap at VM Abort:
    Heap
    def new generation total 576K, used 77K [0x10010000, 0x100b0000, 0x104f0000)
    eden space 512K, 7% used [0x10010000, 0x10019220, 0x10090000)
    from space 64K, 64% used [0x100a0000, 0x100aa4e0, 0x100b0000)
    to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
    tenured generation total 1960K, used 1328K [0x104f0000, 0x106da000, 0x14010000)
    the space 1960K, 67% used [0x104f0000, 0x1063c2e0, 0x1063c400, 0x106da000)
    compacting perm gen total 4096K, used 2584K [0x14010000, 0x14410000, 0x18010000)
    the space 4096K, 63% used [0x14010000, 0x142960f8, 0x14296200, 0x14410000)
    Local Time = Wed Jan 12 07:05:13 2005
    Elapsed Time = 44871
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.2_05-b04 mixed mode)
    #

    3x
    but the bug haven't been fixed ?Could be. But if so it is in a newer version of the odbc driver than the one you have. (Again this has nothing to do with java.)
    The odbc applet in windows allows you to inspect the version number. Depending on your business environment you might be able to find and use a different one. It might be possible to download a newer version from somewhere.
    As I stated another driver (jdbc) is likely to fix the problem as well. Which database are you using?

  • Jdbc odbc connectivity issue

    I have made one system dsn ...in some folder..then in my jsp page my
    Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    Connection myConn = DriverManager.getConnection."jdbc:odbc:Employee");im getting error like no data source...and its finding in root directory like c:/document seting etc etc ..not where my db lies
    if i put my db in root directory .then code wrks fine..but is it taking that root directory

    well well the code would not consider nothing here the microsoft native bridge driver has to find appropriate database.
    Are you sure u have created an entry in Odbc Data Source Administrator --> System DSN -> and you have a name called "Employee" out their pointing to appropriate database which you are trying to connect.

  • JDBC/ODBC Connections using 9iDS?

    I've just installed 9iDS and I noticed that there is no OCA installed. Has anyone with 9iDS tried using JDBC/ODBC to connect to a non-Oracle database?

    Correct we are no longer shipping the OCA - You should be looking at the Oracle gateways as a way of providing non-oracle access for Forms and Reports.
    http://technet.oracle.com/products/gateways/content.html
    You can't plug ODBC or JDBC into Forms as an alternative to SQL*Net (unless you want to do a lot of 3gl coding and Transactional triggers)

  • Please help Urgent:Automaticly the Odbc Connection??

    hi everyone,
    i,m looking for a maner to do the odbc connection automaticly: i have a demo of a software in a CD ,the database is there too and i will take this demo to one customer but i don't like to setup the odbc connection in his Computer , i wan it to start automaticly when i put the CD in his computer
    please any help it's urgent

    hi there, why not use an Object Oriented Database, a good example is Oracle, you could embed the database and use JSQL for connectivity, in this way you will not have to define a name in the ODBC..infact ODBC wont be used here....Check out Oracles OO Database and another example is Jeevan Database, more info http://www.w3apps.com/ ....
    asrar

  • Jdbc-odbc connection - java.langclassNotFoundException

    Hi,
    i have developed an applet which should connect to an Access database and store data in one of its table. Yet when i test the applet the following error is being generated:
    java.lang.classNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver
    can u tell why
    Here is the code i have used:
    void addtodb( )
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    String url="jdbc:odbc:test";
    Connection connection=DriverManager.getConnection(url,"","");
    Statement stmt= connection.createStatement();
    stmt.executeUpdate("INSERT INTO member " +
                   "VALUES ('zben','curepipe','mru')");
    // Close the database
    connection.close();
    }catch(Exception ex){
         message.setText(ex.toString());

    Continued in
    http://forum.java.sun.com/thread.jsp?forum=48&thread=210282&start=0&range=100#718485

  • Inserting data into Ms Access via jdbc odbc connectivity

    Can anyone help dictate what's wrong with this below method which is supposed to be adding new record(append) into my ms Access Table. This is giving me a hell of problem, I thought I have everything well. The module is branched via a Swing ui. Can you debug this ? and send a new code to try?
    public void Query3(){
    try{
    //while(rs.next() )
    stmt.executeUpdate("INSERT INTO pupRegister_Table1 " +
         "VALUES ('1001', 'Simpson', 'Mr.', 'Springfield', '2001')");
    //stmt.executeUpdate ("INSERT INTO pupRegister_Table1 " +
    //"VALUES(var_firstname)");
    // Close the result set, statement and the connection
    rs.close() ;
    stmt.close() ;
    conn.close() ;
    } catch( SQLException se )
    System.out.println( "SQL Exception:" ) ;
    Thanks. Note I have done all the DriverManager stuff already and other modules like for displaying the records, do work fine.

    Thanks a lot,
    that contribution really helped but I realised that I Missed adding the
    insertRow();
    that did the trick and it works fine now
    Thanks
    Yet another issue is about inserting the current date into the date field having data type as date. Hence I am using the Jdbc stuff. I am having problem here
    any further help?

  • JDBC-ODBC connection to MS SQL Server

    Hi All,
    I am new to Java. I want to connect from my JSP page to a remote MS SQL Server. So please tell me where i can find the suitable driver(MS SQL and not SQL Server 2000. I think SQL Server 2000 driver is not compatible with MS SQL Server). It would be of great help if you can give a sample code as well to connect to the database. Thanks.

    sample:
    <%@�@page�@import="java.lang.*,�@java.io.*,�@java.sql.*,�@java.util.*"�@contentType="text/html;charset=gb2312"�@%>
    �@�@<html>
    �@�@<body>
    �@�@<%�@Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
    �@�@�@String�@url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs";
    �@�@�@//pubs�@is your database
    �@�@�@String�@user="sa";
    �@�@�@String�@password="admin";
    �@�@�@Connection�@conn=�@DriverManager.getConnection(url,user,password);
    �@�@�@Statement�@stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
    �@�@�@String�@sql="select�@emp_id,fname�@from�@employee";
    �@�@�@ResultSet�@rs=stmt.executeQuery(sql);
    �@�@�@while(rs.next())�@{�@%>
    �@�@�@�@your first field�F<%=rs.getString(1)%><br>
    �@�@�@�@your second field�F<%=rs.getString(2)%><br>
    �@�@<%�@}�@%>
    �@�@<%�@out.print("congratulations, database operation succeded!");�@%>
    �@�@<%�@rs.close();
    �@�@�@stmt.close();
    �@�@�@conn.close();
    �@�@%>
    �@�@</body>
    �@�@</html>

  • Jdbc-odbc bridge connection error

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

    Hi,
    Please help me to create a jdbc-odbc connection from Jdev10g to a TSM server database.
    I have created a database connection with the following parameters:
    Connection name: tsm1a
    Connection type: jdbc-odbc bridge
    Username: admin
    Password: ***
    Datasource name: tsm1 (this is the name of the DSN datasource name in my Windows ODBC DSN datasource)
    Extra parameters: NONE
    Clicking on the Test button shows Success!
    I have tried to launch the SQL worksheet, it is success and give me a correct result to my "select * from volumes" query.
    I have created a simple JSP page:
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://xmlns.oracle.com/j2ee/jsp/tld/ojsp/sqltaglib.tld"
    prefix="database"%>
    <html>
    <body>
    <database:dbOpen connId="c1" URL="jdbc:odbc:TSM1a" user="admin" password="***">
    <database:dbQuery connId="c1" output="html" queryId="q1" >
    select * from volumes
    </database:dbQuery>
    </database:dbOpen>
    </body>
    </html>
    The result of the run of it:
    javax.servlet.jsp.JspTagException: Failed to establish connection     at oracle.jsp.dbutil.tagext.dbOpenTag.doStartTag(dbOpenTag.java:115)
    Please help me, how to get a connection to the ODBC datasource from a jsp page.
    What is wrong in the URL string or elsewhere ?
    Thanks a lot in advance:
    Arpad

Maybe you are looking for