New to JAVA - ODBC/JDBC - clarification

Hi,
I am using Window XP. I am in my initial stages of learning JAVA.
I am using one of the books to learn the language. I wrote to the following code to interact with the database - "websites.mdb" which is in a different location than java.
import java.sql.*;
public class MakeTheConnection
public static void main (String[] args)
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL = new String ("jdbc:odbc:websites");
Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
catch (ClassNotFoundException cnfe)
System.out.println(cnfe);
catch (SQLException sqle)
System.out.println(sqle);
When I run the above code I am geting the following error:
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
I also tried creating a DSN which I tried using it here in the sourceURL but still in vain, i got the same error. I would really appreciate if somebody could help me in providing pointer or information regarding to solve this problem and be able to interact with databases. I use MS access.
Thanks in advance.
PK

Hi,
I created the file DSN through Control panel - > ODBC called "Test" and I used that in the following manner:
try
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          String sourceURL = new String ("jdbc:odbc:Test");
          Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
I hope that is right. I am trying to execute using these code. I am getting the following error, I am not sure where the problem is.
C:\jdk1.5.0\bin>java MakeTheConnection
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Please do let me know.
Regards,
PK

Similar Messages

  • ODBC - JDBC - Clarification

    Hi,
    I am using Window XP. I am in my initial stages of learning JAVA.
    I am using one of the books to learn the language. I wrote to the following code to interact with the database - "websites.mdb" which is in a different location than java.
    import java.sql.*;
    public class MakeTheConnection
         public static void main (String[] args)
         try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              String sourceURL = new String ("jdbc:odbc:websites");
              Connection DatabaseConnection = DriverManager.getConnection(sourceURL);
         catch (ClassNotFoundException cnfe)
              System.out.println(cnfe);
         catch (SQLException sqle)
              System.out.println(sqle);
    When I run the above code I am geting the following error:
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    I also tried creating a DSN which I tried using it here in the sourceURL but still in vain, i got the same error. I would really appreciate if somebody could help me in providing pointer or information regarding to solve this problem and be able to interact with databases. I use MS access.
    Thanks in advance.
    PK

    The use of a DSN is corrrect. You have to create User or System-DSN with name "websites" (as stated in your JDBC sourceURL) and that DSN connects to the MDB database you're trying to access. Then your program should just work fine.
    For the DSN you have to use the MS-Access driver (afaik language is not important). Then your program should just work fine.

  • Plz help me I'm new to java

    I've created simple data base in sql and a simple html page,here is the code:
    <%@ page import="java.util.*" import="java.sql.*" %>
    <%!
    private String emp_code, emp_name, emp_dept, emp_title, emp_doj, emp_dob;
    private String error, info, create;
    private short age;
    private Statement stmt;
    %>
    <%
    //load the JDBC driver
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection conn = DriverManager.getConnection("jdbc:odbc:Master","","");
    Statement s = conn.createStatement();
    s.executeUpdate("insert into employee_info values('" + emp_code + "', '" + emp_name + "','" + emp_dept + "','" + emp_title + "', '" + emp_doj + "','" + emp_dob + "') ");
    System.out.println ("It has been successfully added");
    %>
    <HTML>
    <HEAD>
         <TITLE> ---: New Employee Information :--- </TITLE>
    </HEAD>
    <BODY>
    <DIV ALIGN="center">
         <H2> New Employee Information </H2></DIV>
    <DIV ALIGN="center">
         <p> � </p></DIV>
         <FORM METHOD = "POST" ACTION = "NewEmp.jsp">
    <H4>Employee Code: <INPUT TYPE= "text" NAME = "first1" SIZE = "17">����
    Name: <INPUT TYPE = "TEXT" NAME = "first" SIZE = "51">�������
    <font size="3">Title:�<SELECT name="Grade">
    <OPTION SELECTED> - Select -
    <OPTION >Programmer
    <OPTION >Technetion
    <OPTION>System Analyst
    <OPTION>Network Administrator
    </SELECT>�</font>
              </H4>
    <H4><font size="3">�</font>
              </H4>
    <H4><font size="3">Department Code:�</font><select name="Dept">
    <OPTION SELECTED> - Select -
    <OPTION >IT
    <OPTION >Admin
    <OPTION>MGM
    <OPTION>CSD
    <OPTION>SM
    <OPTION>FIN
    </SELECT>
    ��������
    <font size="3"><b>DOB: </b> </font> <INPUT TYPE = "TEXT" NAME = "first2" SIZE = "18">������
    <b><font size="3">DOJ: </font></b><INPUT TYPE = "TEXT" NAME = "first3" SIZE = "18">
              </H4>
    <p>�
              </p>
    <P align="center">
    <INPUT TYPE = "SUBMIT" VALUE = "Submit">     
    <INPUT TYPE = "RESET">
    <input type="button" value="Cancel" name="Cancel" onClick='javascript:window.close();'> </FORM>
    <p align="center">�</p>
    </BODY>
    </HTML>
    But I couldn't complete it or make the connection to the database, I want to fill in the blanks and then add it to the data base.
    My database name is doctrak and the table name is employee_info and below the design of the table :
    emp_code     char     10
    emp_name char     30     
    emp_dept     char     15     
    emp_title     char     10     
    emp_doj     datetime     8     
    emp_dob     datetime     8     
    I've installed the apatchi tomcat 401 and make the java environment.
    So plz can any one help me in that?
    Thanks

    But I don't know how to handel the code, I didn't
    study JSP or Java. I'm trying to learn it by doing
    this, so please can you write the code for me in jsp
    and how to put it in html then , how to do the
    connection to my database?Iam sorry to disappoint you, but no.
    If you are new to java and jsp taking up such a task to learn it is not ideal, nor
    viable. I would suggest you learn the basics of the language first, then the basics
    of jsp, then some jdbc and finally graduate to the example in question. There are
    excellent tutorials avbl for all on the net.
    Maybe someone else would even post the code here, but suggest you dont
    waste time waiting on it.
    All the best.
    Cheers,
    ram.

  • "java ODBC Microsoft Access Driver Syntax error (missing operator) in query

    Hi I am new to java and I am getting this error message when using java to access and insert data into an MS Access database.
    "java ODBC Microsoft Access Driver Syntax error (missing operator) in query expression"
    The commands are
    String insertCommand = "INSERT into MetricOutput(A1,A,DRR,DeRR,RE,WDRR,WDeRR,WRE,ARF,SRF,HRF,WARF,WSRF,WHRF,SDC,WSDC,MAR,WMAR,H1,H11,H2,H21,cluster) "+
                             "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";

    "VALUES("+comMappedCount+","+stdCount+","+DRR+","+DeRR+","+RE+","+WDRR+","+WDeRR+","+WRE+","+ARF+","+SRF+","+HRF+","+WARF+","+WSRF+","+WHRF+","+SDC+","+WSDC+","+MAR+","+WMAR+","+H1+","+H11+","+H2+","+H21+",+array)";After looking at your post in the editor, I see what your real query looks like.  You realize that ",+array[i])" is part of the query, right?  And not actually looking at your Java array?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • New to Java - problem with form with DB connectivity

    Hi
    i'm new to java. And i have designed one HTML form which is having the following fields name,email, date(i used drop down box for this dd/mm/yy) and comments. Now i want to insert these data into Database. I'm using MS Access DB. I dont know how to connect and retrive data from DB. Any can help and guide me? Its very urgent. And also want to know the purpose of using JSP, SERVLETS and JDBC.
    Regards,
    Prabu

    You can start with these links:
    [1] http://java.sun.com/products/servlet/
    [2] http://java.sun.com/products/jsp/
    [3] http://java.sun.com/javaee/5/docs/tutorial/doc/
    [4] http://java.sun.com/docs/books/tutorial/jdbc/
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://faq.javaranch.com/java/HowToAskQuestionsOnJavaRanch
    ----------------------------------------------------------------

  • New Look of Oracle JDBC & UCP Forum

    Hi All,
    We have enhanced existing Oracle JDBC & UCP forum with a new look.
    You will now find all Oracle JDBC resources such as latest white papers, FAQ, Blogs, Tweets etc., in this forum.
    Please post your JDBC & UCP questions specific to Oracle Database here at Oracle JDBC & UCP.
    Note that this forum is only for Java related JDBC questions.
    Thanks,
    Nirmala

    Kmensah-Oracle wrote:
    The generic Java Connectivity is inherited from SUN and destined for questions related to JDBC spec and every vendor while the Oracle JDBC forum is dedicated to our drivers. These two were joined for a moment, by mistake.
    However, if the community strongly feels we should re-join, we can look into that.
    Kuassi @kmensah)
    Re-joining would be MY preference. I first posted a 'why two forum' question in the community feedback forum last year when I first discovered that 'other' forum:
    Why are there two DIFFERENT JDBC forums?
    That second forum only has three recent threads and, so far as I know, just became visible when some recent changes were made to the Jive software.
    It is located at
      All Places > Database > Database Developer Tools > JDBC
    Can someone research and determine if that second forum should just be consolidated with the main JDBC forum? I contribute ALL of the time to the other forum as does one of the JDBC developers. I never knew this other one existed so I doubt if people will get much help there.
    If you read the thread you will see that I never got a reply from anyone.
    But the comments above that I made then still apply. Joe Weinstein (one of Oracle's JDBC experts) and I have been the top contributors on this current forum for some time. I don't believe either of us posted in that 'other' forum and I didn't even know it existed. The link in my thread above to the original 'other' forum still works but gives an 'unauthorized' message so I assume it is now an internal Oracle site.
    My opinion is that people with a JDBC question and just going to post in the first one they find which is usually this forum I am in now. I don't think the general public will understand the 'fine' distinction you provided above for Oracle related versus non-Oracle related JDBC questions.
    So the main issue for me is that there is no good way to respond to someone that posts their question in the WRONG jdbc forum. For other forums we just do NOT reply to the question but ask them to post in the correct forum and provide a link to it: I run across this most frequently in the Sql Developer forum and usually respond with:
    Wrong forum!
    This forum is ONLY for Sql Developer quesstions and your question is NOT related to Sql Developer. Please mark this thread ANSWERED and repost it in the Sql Developer forum
    SQL Developer
    The result is that by providing the link to the correct forum the Jive software creates a SECOND thread in that other forum.
    The bulk of the JDBC questions posted in this current forum are, in fact, for the Oracle database. The few that aren't are easily answered by providing what help we can, suggesting additional info that needs to be provided and then suggesting that they post in an IBM, Sql Server or other vendor forum for the JDBC product for their database.
    Havng just ONE forum for JDBC would make it easier to provide a higher level of support to users in my opinion.

  • Problem with Sun Java Creator JDBC driver .....

    Hi:
    I am new to Java Studio Creator. I am using Oracle Enterprise Edition 8.0.5.0 database to get data from. Through Servers Navigator->Data Sources, I define a new datasource using default JSC JDBC driver for Oracle. However, when I try to test the connection I get the following error.
    [sunm][Oracle JDBC Driver] Internal Error: Net8 Protocol Error
    Can someone tell me what is going on here? By the way I also have Netbeans 4.0 IDE which works fine with the same database.
    -Victor bagga

    I was using the following database URL.
    jdbc:sun:oracle://autoserv.cqtel.com:1521;SID=autosvdb
    The SID is valid because I can use other JDBC drivers such as Oracle's thin driver which uses the Database URL
    jdbc:oracle:thin:@autoserv.cqtel.com:1521:autosvdb
    and it works. However, I can not use the Oracle thin JDBC driver with Sun Java Creator as it seems to be incompatible. Using this driver I can successfully define a datasource and veiw all the data and make all kind of queries through the Server Navigator window but when I try to drop a database table on to a Data Table in my project, nothing happens. If I try to Edit the query on the rowset, the GUI window does not show any Column names and display names.
    By the way, I also have an Oracle 9.x database which works just fine with Java Ctreator Studio. I really like Java Creator as I find it very productive but not being able to make it work with Oracle 8.0.5.0 takes the fun out of it.

  • ODBC-JDBC Bridge

    Hello everybody,
    I am working on project to create an ODBC-JDBC Bridge which exposes a JNI layer between the ODBC and the JDBC calls.
    In short :
    Lets consider,
    Java already has a JDBC driver. X is a project manager who wants to use the functionality of this driver in C++. One option is to rewrite the entire driver in C++. X is now worried because he does not want to waste time and resource in doing this resource. In mean time Y gives a valid suggestion. He proposes to replicate the entire class structure of the JDBC driver. Effectively he would end up writing a wrapper class that exposes JNI methods to talk to the JDBC driver. So the classes he finally develops are just wrappers which send and get data to and from the driver.
    My Progress :
    Basically I tool following approach :
    1. I created a JNI wrapper class that would replicate all the Java classes embedded in the jar files.Please note here that the C++ code is just act as a wrapper.The Wrapper is only acting as an access point between the C++ and the JAVA code.
    2. Now how to use these wrapper to bridge ODBC - JDBC driver?
    Can anyone please give me right direction after step 1 (any type of valid suggestions are accepted .... documents,links,steps,flow etc....)?
    Thanks in Advance....

    Is this a real project? What are the actual requirements, since this seems a little backwards. What is the actual database that has a JDBC driver but no ODBC driver. Writing the driver in C or C++ is probably a better choice.
    Or is this an academic exercise?
    And yes, these questions are "valid suggestions", and even if they weren't you have no control over what responses you will get on this forum.

  • Create new daba base over jdbc-Driver

    Hi,
    i use the mySql-DB with the mm.mysql.jdbc-1.2c-JDBC-Driver.
    Its working fine!
    But how can I create a new database thru the JDBC-Driver?
    Thanks
    Daniel :-)

    i don't know if this wil work but with a access database with ODBC it works like this.....
                   try
              Class.forName( "sun.jdbc.odbc.JdbcOdbcDriver" );
                        connection = DriverManager.getConnection(
         url, username, password );
              catch ( ClassNotFoundException cnfex )
              System.err.println(
         "Failed to load JDBC/ODBC driver." );
              cnfex.printStackTrace();
              System.exit( 1 ); // terminate program
              catch ( SQLException sqlex )
              System.err.println( "Unable to connect" );
              sqlex.printStackTrace();
    Statement stmt = connection.createStatement();
    stmt.executeUpdate("CREATE TABLE TABLENAME(ROWNAME TYPEDATA(xx), rowname VARCHAR(19))");
    connection.close();

  • TP4: can not run application with ODBC-JDBC bridge

    Hi,
    I tried to connect to a oracle 10gR1 Database via ODBC-JDBC bridge.
    Test connection in dialog "Edit Database Connection" is sucessfull.
    When trying to run the application following error occures:
    ===========================================
    08/05/09 11:48:57 SCHWERWIEGEND: AbstractInfo.getAnnotation oracle.webservices.annotations.async.AsyncWebService cannot be found in the given classpath.
    08/05/09 11:48:57 SCHWERWIEGEND: AbstractInfo.getAnnotation oracle.webservices.annotations.async.AsyncWebService cannot be found in the given classpath.
    09.05.2008 11:48:58 oracle.j2ee.util.AnnotatedLogger logWithThrowable
    SCHWERWIEGEND: J2EE JCA-07001
    oracle.oc4j.sql.DataSourceException: Unable to create: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:403)
         at oracle.oc4j.sql.DataSourceUtils.createDataSource(DataSourceUtils.java:288)
         at com.evermind.server.DataSources.createNativeDataSource(DataSources.java:153)
         at com.evermind.server.DataSources.initDataSources(DataSources.java:1117)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1782)
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1436)
         at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:422)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:247)
         at com.evermind.server.Application.setConfig(Application.java:538)
         at com.evermind.server.Application.setConfig(Application.java:433)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:2125)
         at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1865)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1235)
         at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:249)
         at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:401)
         ... 15 more
    08/05/09 11:48:58 WARNUNG: Application.setConfig Application: current-workspace-app is in failed state as initialization failed.
    java.lang.InstantiationException: oracle.oc4j.sql.DataSourceException: Unable to create: sun.jdbc.odbc.JdbcOdbcDriver
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1465)
         at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:422)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:247)
         at com.evermind.server.Application.setConfig(Application.java:538)
         at com.evermind.server.Application.setConfig(Application.java:433)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:2125)
         at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1865)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1235)
         at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:249)
         at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.oc4j.sql.DataSourceException: Unable to create: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:403)
         at oracle.oc4j.sql.DataSourceUtils.createDataSource(DataSourceUtils.java:288)
         at com.evermind.server.DataSources.createNativeDataSource(DataSources.java:153)
         at com.evermind.server.DataSources.initDataSources(DataSources.java:1117)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1782)
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1436)
         ... 10 more
    Caused by: java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:401)
         ... 15 more
    09.05.2008 11:48:58 com.evermind.server.ServerMessages severe
    SCHWERWIEGEND: Exception beim Initialisieren der bereitgestellten Anwendung: current-workspace-app. Application: current-workspace-app is in failed state as initialization failed
    java.lang.InstantiationException: Application: current-workspace-app is in failed state as initialization failed
         at com.evermind.server.Application.setConfig(Application.java:636)
         at com.evermind.server.Application.setConfig(Application.java:433)
         at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:2125)
         at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1865)
         at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1235)
         at oracle.oc4j.server.ServerFactory$Worker.start(ApplicationServerFactory.java:249)
         at oracle.oc4j.server.ServerFactory$Worker.run(ApplicationServerFactory.java:259)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: java.lang.InstantiationException: oracle.oc4j.sql.DataSourceException: Unable to create: sun.jdbc.odbc.JdbcOdbcDriver
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1465)
         at com.evermind.server.ApplicationStateRunning.initConnectors(ApplicationStateRunning.java:422)
         at com.evermind.server.ApplicationStateRunning.initializeApplication(ApplicationStateRunning.java:247)
         at com.evermind.server.Application.setConfig(Application.java:538)
         ... 7 more
    Caused by: oracle.oc4j.sql.DataSourceException: Unable to create: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:403)
         at oracle.oc4j.sql.DataSourceUtils.createDataSource(DataSourceUtils.java:288)
         at com.evermind.server.DataSources.createNativeDataSource(DataSources.java:153)
         at com.evermind.server.DataSources.initDataSources(DataSources.java:1117)
         at com.evermind.server.ApplicationStateRunning.initDataSourceConnector(ApplicationStateRunning.java:1782)
         at com.evermind.server.ApplicationStateRunning.initConnector(ApplicationStateRunning.java:1436)
         ... 10 more
    Caused by: java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcDriver
         at oracle.oc4j.sql.config.DataSourceConfigUtils.createDataSource(DataSourceConfigUtils.java:401)
         ... 15 more
    09.05.2008 11:48:58 oracle.j2ee.util.AnnotatedLogger logWithThrowable
    WARNUNG: J2EE JNDI-00002
    09.05.2008 11:48:58 oracle.j2ee.util.AnnotatedLogger log
    WARNUNG: Kein javax.jms.ConnectionFactory in null gefunden
    09.05.2008 11:49:01 com.evermind.server.http.HttpMessages internalErrorWhileTryingToInstantiate
    SCHWERWIEGEND: Interner Fehler ausgelöst beim Versuch, die Web-Anwendung zu instanziieren: GoodsReceipt-ViewController-webapp definiert in Website Default Web Site. Application: current-workspace-app does not exist. Error creating Web application: GoodsReceipt-ViewController-webapp
    Ready message received from Oc4jNotifier.
    Embedded OC4J Server startup time: 12375 ms.
    =========================================
    OC4J is up and running, but browser gives error message (404 Not found)
    With JDBC connection this application works fine.
    Here my jdev specific environment variables:
    SET JOH=c:\software\Oracle_JDEV11gP4
    SET JDEV_USER_DIR=c:\jdeveloper\home
    SET JAVA_HOME=c:\software\Oracle_JDEV11gP4\jdk\bin
    Can anybody help me?
    br
    Peter

    Peter --
    Can you please describe your use case? The JDBC-ODBC bridge driver is not all that reliable. Sun considers it "transitional" and it is not supported by them.
    http://java.sun.com/j2se/1.5.0/docs/guide/jdbc/bridge.html
    We still include the driver in JDev primarily to allow connections to MS datasources like Excel and Access that don't have free/open-source pure JDBC drivers. Why would you use the JDBC-ODBC bridge to connect to an Oracle database?
    -- Brian

  • Easysoft odbc jdbc bridge

    I have written aprogram which reading data from Msaccess using easysoft odbc jdbc bridge . but got error in connectivity looks like something wrong in
    Class.forName ("jdbc.easysoft");
    pls help if anybody is using easysoft bridge
    thx

    LanceJ wrote:
    I'm facing a challenge providing ODBC for an in-memory Java application. There are commercial frameworks such as Simba and DataDirect but both involve extensive licensing and are too elaborate (given only read-only capability with basic single table querying required).
    As stated that is not possible.
    Read the following and then restate the question
    [http://forums.sun.com/thread.jspa?threadID=211735&start=2&forumID=48]
    Another option I'm investigating is to use an ODBC-JDBC bridge driver (such as provided by EasySoft) in combination with a bespoke JDBC connector. The question is, how complex is it to implement a SELECT-only JDBC driver to interface directly with a Java app? (And as extension, are there any libraries that can assisting in creating a JDBC driver?)That doesn't make sense.
    The bridge and any "ODBC" interface is going to interact with the ODBC shell and a ODBC driver (nothing to do with java.) You can't create a ODBC driver without creating a ODBC driver. Which would seem obvious.
    If you want to create a JDBC driver - which is not the same as an ODBC driver then you must implement the interfaces. Simple as that. That however requires that you must have some way to actually access the database.

  • How can I open help file (HTML or .chm) from Java Web Start (new to JAVA)

    Hi All,
    Im trying to open the help file of my application.
    When trying to access the help file from the GUI (pressing F1 for launching the help file), I'm geting the an error, something like:
    "Can't show help URL: jar:file:C:\Documents and Settings\%USER%\Application Data\Sun\Java\Deployment\javaws\cache\http\Dlocalhost\P7001\DMwebstart\RMjar-name!/com/resources/helpFiles/MyHelpFile.html"
    It seems that the file which is packed in a jar, was downloaded to the Java Web Start cache directory:
    C:\Documents and Settings\%USER%\Application Data\Sun\Java\Deployment\javaws\cache\http\Dlocalhost\P7001\DMwebstart
    The code which is activated when launching the help file is:
    try
                ResourceBundle resourceBundle = DoubleResourceBundle.getBundle("Resource", "ResourceImpl");
                RuntimeUtil.launchFile(new File(resourceBundle.getString("help.file")));
            } catch (IOException e)
                // TODO Auto-generated catch block
                e.printStackTrace();
            }where the property "help.file" is in some property file in the resource bundle named "Resource", and looks like this :
    help.file="com/trax/docs/help/global/MyHelpFile.html"
    The function "RuntimeUtil.launchFile" knows how to launch any file in its default application, and indeed it does launches the html, when giving it an absolute path to the file on my PC, as "C:\Helpfiles\MyHelpFile.html" as such:
    RuntimeUtil.launchFile("C:\Helpfiles\MyHelpFile.html");My question is :
    The application is going to be deployed on a Customer PC. How can I access the html file from the code, with a relative path and not its absolute path on the customer pc, which I can't know?
    I found these restrictions regarding web start:
    (copied from "http://rachel.sourceforge.net/"):
    *Rule 1: Java Archives only. No loose files.* All your resources have to be packaged in Java Archives (jar) if you want to have
    them delivered to the user's machine and kept up-to-date automatically by Java Web Start.
    *Rule 2: No file paths.* You can't use absolute or relative file paths to locate your
    jars holding your resources (e.g. <code>jar:file:///c:/java/jws/.cache/resources.jar</code>).
    Absolute file paths won't work because you never know where Java Web Start
    will put your jar on the user's machine. Relative file paths won't work because Java Web Start
    mangles the names of your jars (e.g. <code>venus.jar</code> becomes <code>RMvenus.jar</code>)
    and every JNLP client implementation has the right to mangle your names
    in a different way and you, therefore, can't predict the name with
    which your jar will be rechristend and end up on the user's machine in
    the application cache.Seems complex or impossible, to perform a simple task like opening a file.
    Please advise (I'm new to Java and Web Start).
    BTW, I'm working with IntelliJ IDEA 5.0.
    Thanks,
    Zedik.
    {font:Tahoma}{size:26pt}
    {size}{font}

    the follwing method i have used to open html file ...
    so to access html file i am shipping resources folder with jar file ..
    private void openHtmlPages(String pageName) {
         String cmd[] = new String[2];
         String browser = null;
         File file = null;
         if(System.getProperty("os.name").indexOf("Linux")>-1) {
              file = new File("/usr/bin/mozilla");
              if(!file.exists() ) {
              }else     {
                   browser = "mozilla";
         }else {
              browser = "<path of iexplore>";
         cmd[0] = browser;
         File files = new File("");
         String metaData = "/resources/Help/Files/"+pageName+".html"; // folder inside jar file
         java.net.URL url = this.getClass().getResource(metaData);
         String fileName = url.getFile();
         fileName = fileName.replaceAll("file:/","");
         fileName = fileName.replaceAll("%2520"," ");
         fileName = fileName.replaceAll("%20"," ");
         fileName = fileName.replaceAll("jarfilename.jar!"," ").trim();
         cmd[1] = fileName;     
         try{
              Process p = Runtime.getRuntime().exec(cmd);
         }catch(java.io.IOException io){
                   //Ignore
    can anyone give me the solution..???
    Regards
    Ganesan S

  • What is new in Java syntaxes in new Java versions?

    What is new in Java syntaxes in new Java versions?
    What about this sentenses
    1. for (int c:data), where data is array of integer
    2. ArrayList<Object> () ...
    3. Class<?>...
    I can't find this syntaxes in my books and documentation...
    And what Java version is latest?

    dont crosspost
    Edited by language police

  • What's new in Java 4

    Anybody can quickly explain the things are added in Java 4 newly.
    Thnx in advance.

    Nothing's new in Java 4 because there is no Java 4.
    Maybe you mean Java 5?
    Or maybe you mean Java 1.4?
    In either case, either the download page for that version, or the installation, should have release notes that answer your question.
    In fact, here they are for Java 5:
    http://java.sun.com/j2se/1.5.0/docs/relnotes/features.html

  • New TO JAVA Programming

    Dear Forummembers,
    I am student doing postgraduate studies in IT.i have some queries related to one of my programming staff.i am very much new into Java programming and i am finding it a bit difficult to handle this program.The synopsis of the program is given below -
    You are required to design and code an object-oriented java program to process bookings for a theatre perfomance.
    Your program will read from a data file containing specifications of the performance,including the names of the theatre, the play and its author and the layout of the theatre consisting of the number of seats in each row.
    It will then run a menu driven operation to accept theatre bookings or display the current
    status of seating in the theatre.
    The name of the file containing the details of the performance and the theatre should be
    provided at the command line, eg by running the program with the command:
    java Booking Theatre.txt
    where Theare.txt represents an example of the data file.
    A possible data file is:
    Opera
    U and Me
    Jennifer Aniston
    5 10 10 11 12 13 14
    The data provided is as follows
    Line 1
    Name of the Theatre
    Line 2
    Name of the play being performed
    Line 3
    Name of the author of the play being performed
    Line 4
    A list of the lengths (number of seats) of each row in the theatre, from front to
    back.
    The program must start by reading this file, storing all the appropriate parameters and
    establishing an object to accept bookings for this performance with all details for the theatre
    and performance.
    The program should then start a loop in which a menu is presented to the user, eg:
    Select from the following:
    B - Book seats
    T - Display Theatre bookings
    Q - Quit from the program
    Enter your choice:
    And keep performing selected operations until the user�s selects the quit option, when the
    program should terminate.
    T - Display Theatre bookings
    The Display Theatre Bookings option should display a plan of the theatre. Every available
    seat should be displayed containing its identification, while reserved seats should contain an
    Rows in each theatre are indicated by letters starting from �A� at the front. Seats are
    numbered from left to right starting from 1. A typical seat in the theatre might be designated
    D12, representing seat 12 in row D.
    B - Book seats
    The booking of seats is to offer a number of different options.
    First the customer must be asked how many adjacent seats are
    required. Then start a loop offering a further menu of choices:
    Enter one of the following:
    The first seat of a selected series, eg D12
    A preferred row letter, eg F
    A ? to have the first available sequence selected for you
    A # to see a display of all available seats
    A 0 to cancel your attempt to book seats
    Enter your selection:
    1. If the user enters a seat indentifier such B6, The program should attempt to
    reserve the required seats starting from that seat. For example if 4 seats are
    required from B6, seats B6, B7, B8 and B9 should be reserved for the customer,
    with a message confirming the reservation and specifying the seats reserved..
    Before this booking can take place, some testing is required. Firstly, the row
    letter must be a valid row. Then the seat number must be within the seats in the
    row and such that the 4 seats would not go beyond the end of the row. The
    program must then check that none of the required seats is already reserved.
    If the seats are invalid or already reserved, no reservation should be made and the
    booking menu should be repeated to give the customer a further chance to book
    seats.
    If the reservation is successful, return to the main menu.
    2. The user can also simply enter a row letter, eg B.IN this case, the program should
    first check that the letter is a valid row and then offer the user in turn each
    adjacent block of the required size in the specified row and for each ask whether
    the customer wants to take them. Using the partly booked theatre layout above, if
    the customer wanted 2 seats from row B, the customer should be offered first:
    Seats B5 to B6
    then if the customer does not want them:
    Seats B10 to B11
    and finally
    Seats B11 to B12
    If the customer selects a block of seats, then return to the main menu. If none are
    selected, or there is no block of the required size available in the row, then report
    that no further blocks of the required size are available in the row and repeat the
    booking menu.
    3. If the user enters a ? the program should offer the customer every block of seats
    of the required size in the whole theatre. This process should start from the first
    row and proceed back a row at a time. For example, again using the partially
    booked theatre shown above, if the user requested 9 seats, the program should
    offer in turn:
    Seats A1 to A9
    Seats C1 to C9
    Seats C2 to C10
    Seats E3 to E11
    Seats E4 to E12
    If the customer selects a block of seats, then return to the main menu. If none are
    selected, or there is no block of the required size available in the whole theatre,
    then report that no further blocks of the required size are available and repeat the
    booking menu.
    4. If the user enters a # the program should display the current status of the seating
    in the theatre, exactly the same as for the T option from the main menu and then
    repeat the booking menu.
    5. If the user enters a 0 (zero), the program should exit from the booking menu back
    to the main menu. If for example the user wanted 9 seats and no block of 9 was
    left in the theatre, he would need to make two separate smaller bookings.
    The program should perform limited data validation in the booking process. If a single
    character other than 0, ? and # is entered, it should be treated as a row letter and then tested
    for falling within the range of valid rows, eg A to H in the example above. Any invalid row
    letters should be rejected.
    If more than one character is entered, the first character should be tested as a valid row letter,
    and the numeric part should be tested for falling within the given row. You are NOT
    required to test for valid numeric input as this would require the use of Exception handling.
    You are provided with a class file:
    Pad.java
    containing methods that can be used for neat alignment of the seat identifiers in the theatre
    plan.
    File Processing
    The file to be read must be opened within the program and if the named file does not exist, a
    FileNotFoundException will be generated. It is desirable that this Exception be caught and
    a corrected file name should be asked for.
    This is not required for this assignment, as Exception handling has not been covered in this
    Unit. It will be acceptable if the method simply throws IOException in its heading.
    The only checking that is required is to make sure that the user does supply a file on the
    command line, containing details of the performance. This can be tested for by checking the
    length of the parameter array args. The array length should be 1. If not, display an error
    message telling the user the correct way to run the program and then terminate the program
    System.exit(0);
    The file should be closed after reading is completed.
    Program Requirements
    You are expected to create at least three classes in developing a solution to this problem.
    There should be an outer driving class, a class to represent the theatre performance and its
    bookings and a class to represent a single row within the theatre.
    You will also need to use arrays at two levels. You will need an array of Rows in the Theatre
    class.
    Each Row object will need an array of seats to keep track of which seats have been reserved.
    Your outer driving class should be called BookingOffice and should be submitted in a file named BookingOffice.java
    Your second, third and any additional classes, should be submitted in separate files, each
    class in a .java file named with the same name as the class
    I am also very sorry to give such a long description.but i mainly want to know how to approach for this program.
    also how to designate each row about it's column while it is being read from the text file, how to store it, how to denote first row as row A(second row as row B and so on) and WHICH CLASS WILL PERFORM WHICH OPERATIONS.
    pls do give a rough guideline about designing each class and it's reponsibilty.
    thanking u and looking forward for your help,
    sincerely
    RK

    yes i do know that........but can u ppl pls mention
    atleast what classes shud i consider and what will be
    the functions of each class?No, sorry. Maybe somebody else will, but in general, this is not a good question for this forum. It's too broad, and the question you're asking is an overall problem solving approach that you should be familiar with at this point.
    These forums are best suited to more specific questions. "How do I approach this homework?" is not something that most people are willing or able to answer in a forum like this.

Maybe you are looking for

  • Duplicates in lightroom

    Topic duplicates in lightroom Leni - 05:54pm Mar 1, 2008 Pacific Just imported photos into lightroom and found many duplicates. is there an easy way to get rid of duplicates? I am looking for an automation method of doing this. Imac 24, 2gigs ram, 75

  • How to remove create book mark link

    Hi Gurus, When I am navigating from Rep1 to Rep2 in dashboard I am getting some Create Bookmark link,Refresh links in Rep2 ..how to remove those links?

  • IPhone SDK installation problem

    Hi All, I have a problem installing the iPhone SDK. In the installation process, "Installation Type" page, the page you can choose modules either you want to install or not. I see "iPhone SDK" module is listed, but i couldn't select it, it's greyed o

  • Issue happened for SFSY-FORMPAGES sometimes

    I took SFSY-FORMPAGES to display the total pages, most of time, it works very well, but some time, the total pages are displayed as '*'. After deleting some spool on own spool list, it works again. Please give some advice.

  • How do I access my Captivate Subscription Edition?

    I bought the Captivate Subscription Edition but for the life of me I can't figure out where to go to start using it. I tried accessing it through the Creative Cloud interface, but it doesn't seem to be listed there. I already received a welcome email