Foxpro connectivity with java

can any body tell me how to connect the foxpro (.dbf) file with my java program. i have already tried this
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:dsn_foxpro", " ", " ");
but this work only for the whole database not for a single table within it, can any body help me in solving this problem

The Foxpro ODBC lets you set up a DSN for either a database or free table. Try setting up a DSN for just that table.
I have found though, that even if you have a DSN set up for a database, you can still do selects off of a single table.

Similar Messages

  • How to control tcp connection with java tcp socket programing ??

    Hi,
    I am connecting a server as using java socket programming.
    When server close the connection (socket object) as using close() method ,
    I can not detect this and My program continue sending data as if there is a connection with server.
    How to catch the closing connection ( socket ) with java socket programming.
    My Client program is as following :
    import java.io.PrintWriter;
    import java.net.Socket;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        try
                          socket = new Socket("localhost",5555);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            pw.println(i+". message is being send.");
                            Thread.sleep(5000);
        } catch (Exception ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

    I changed the code as following. But I couldn't catch the EOFException when I read from the socket. How can I catch this exception ?
    import java.io.BufferedReader;
    import java.io.EOFException;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.PrintWriter;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class client
      public client()
       * @param args
      public static void main(String[] args)
        Socket socket=null;
        PrintWriter pw=null;
        BufferedReader bufIn=null;
        InputStreamReader inRead=null;
        InputStream in=null;
        try
                          socket = new Socket("localhost",5555);
                          in = socket.getInputStream();
                          inRead = new InputStreamReader(in);
                          bufIn = new BufferedReader(inRead);
                          pw = new PrintWriter(socket.getOutputStream(),true);
                          int i=0;
                          while (true)
                            i++;
                            try
                              bufIn.readLine();
                              pw.println(i+". message is being send.");
                              System.out.println(i+". message has been send");
                            } catch (Exception ex2)
                              System.out.println(ex2.toString());
                              System.out.println(i+". message could not be send");
                            } finally
                            Thread.sleep(5000);
        } catch (EOFException ex)
                          ex.printStackTrace();
        } catch (InterruptedException ex)
                          ex.printStackTrace();
        } catch (IOException ex)
                          ex.printStackTrace();
        } finally
                          try
                            if(pw!=null)pw.close();
                            if(socket!=null)socket.close();
                          } catch (Exception ex)
                            ex.printStackTrace();
                          } finally
    }

  • SAS connectivity with JAVA

    Hi,
    I have a piece of code to connect to SAS data set i have taken the drivers provided by SAS and the below code is giving error saying server not accepting userid/password but with that userid and password i can connect to SAS in other applications can any body suggest what's wrong with this.
    Driver driver=(Driver)  Class.forName("com.sas.net.sharenet.ShareNetDriver").newInstance();         System.out.println("Driver loaded");         System.out.println("JDBC:"+driver.jdbcCompliant());         String url="jdbc:sharenet://164.56.174.116:8591";         Properties credentials=new Properties();         credentials.put("user","userName");         credentials.put("password","Password");         Connection connection=driver.connect(url,credentials);         System.out.println("Connection made");         connection.close();         System.out.println("Connection closed");
    i am getting this error
    Exception in thread "main" java.sql.SQLException: Sharenet.S58.ex.txt: Sharenet.S279.ex.txt: Sharenet.S06.ex.txt: Userid/Password not accepted by server...         at com.sas.net.sharenet.ShareNetConnection.<init>(ShareNetConnection.java:219)         at com.sas.net.sharenet.ShareNetDriver.connect(ShareNetDriver.java:165)

    Once you get past actually getting a driver the configuration of it is entirely driver dependent.
    There are at least four ways that I can't think of to do use validation. There could be others. They way you have choosen, if supported at all, might be dependent on the exact name used. For example (not necessarily a solution) it could be that instead of 'user' you need 'usr' or 'User'.
    Often this involves looking at the driver documentation and just guesssing until something works.

  • Filenet connection with java api not working

    I have written the following code to connect content engine and process engine..
    MY content engine is connected fine and good...But process engine is not connecting
    code:
    public String PE_CONNECTION_POINT      = "PEConnection";
    public Connection ceConnection;
    public Domain ceDomain;
    public void testFileNetConnection()
    * Connect to Content Engine and retrieve a list of
    * properties for the base 'Document' document class
    ceConnection =
    Factory.Connection.getConnection(FILENET_URI);
    Subject ceSubject =
    UserContext.createSubject(ceConnection, FILENET_USERNAME, FILENET_PASSWORD, null);
    UserContext.get().pushSubject(ceSubject);
    ceDomain = Factory.Domain.fetchInstance(ceConnection, CE_DOMAIN, null);
    ObjectStore ceObjectStore = Factory.ObjectStore.fetchInstance(ceDomain, CE_OBJECTSTORE, null);
    ClassDefinition classDef =
    Factory.ClassDefinition.fetchInstance(ceObjectStore, "pawan", null);
    PropertyDefinitionList properties = classDef.get_PropertyDefinitions();
    for (Iterator propertyIter = properties.iterator(); propertyIter.hasNext();) {
    PropertyDefinition property = (PropertyDefinition) propertyIter.next();
    System.out.println("Property: " + property.get_DisplayName());
         //this.instantiateFolder(ceObjectStore);
         //this.createFile(ceObjectStore, ceDomain);
    UserContext.get().popSubject();
    * Connect to Process Engine and retrieve a list of
    * Queues for this Connection Point
    VWSession peSession = new VWSession();
    peSession.setBootstrapCEURI(FILENET_URI);
    String[] queueNames = null;
    try
         peSession.logon(FILENET_USERNAME ,FILENET_PASSWORD,PE_CONNECTION_POINT);
         queueNames =
         peSession.fetchQueueNames(VWSession.QUEUE_PROCESS);
    catch(Exception es){es.printStackTrace();}
    for (String queue : queueNames)
    System.out.println("Queue: " + queue);
    The output of above code I have attached part of successful connection of the content engine and the error of process engine
    Property: Ignore Redirect
    Property: Entry Template Object Store Name
    Property: Entry Template Launched Workflow Number
    Property: Entry Template Id
    java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ObjectURL
         at filenet.pe.peorb.client.ORBSession.establishORBSession(ORBSession.java:667)
         at filenet.pe.peorb.client.ORBSession.<init>(ORBSession.java:985)
         at filenet.vw.server.PECommandsFactory.getPECommands(PECommandsFactory.java:119)
         at filenet.vw.api.VWSession.logonByDomain(VWSession.java:864)
         at filenet.vw.api.VWSession.logon(VWSession.java:723)
         at FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:97)
         at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
    Caused by: java.lang.NoClassDefFoundError: com/ibm/CORBA/iiop/ObjectURL
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Unknown Source)
         at com.ibm.websphere.naming.WsnInitialContextFactory.init_implClassCtor(WsnInitialContextFactory.java:172)
         at com.ibm.websphere.naming.WsnInitialContextFactory.getInitialContext(WsnInitialContextFactory.java:112)
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.init(Unknown Source)
         at javax.naming.InitialContext.<init>(Unknown Source)
         at filenet.pe.peorb.client.ORBServiceHelper.getORB(ORBServiceHelper.java:442)
         at filenet.pe.peorb.client.ORBServiceHelper.initFromORBRouterInfo(ORBServiceHelper.java:286)
         at filenet.pe.peorb.client.ORBServiceHelper.<init>(ORBServiceHelper.java:873)
         at filenet.pe.peorb.client.ORBSession.establishORBSession(ORBSession.java:653)
         ... 6 more
    Exception in thread "main" java.lang.NullPointerException
         at FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:104)
         at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
    When to remove the above error I add IBMORB.jar in enviroment variable then I get following error
    log4j:WARN The log4j system is not properly configured!
    log4j:WARN All ERROR messages will be sent to the system console until proper configuration has been detected.
    Exception in thread "main" com.filenet.api.exception.EngineRuntimeException: SECURITY_INVALID_CREDENTIALS: Invalid credentials.
         at com.filenet.apiimpl.wsi.ClientOperation.getCredential(ClientOperation.java:303)
         at com.filenet.apiimpl.wsi.ClientOperation.setCallContext(ClientOperation.java:194)
         at com.filenet.apiimpl.wsi.ClientOperation.start(ClientOperation.java:102)
         at com.filenet.apiimpl.wsi.ClientOperation.run(ClientOperation.java:69)
         at com.filenet.apiimpl.wsi.ServiceSession.getObjects(ServiceSession.java:242)
         at com.filenet.apiimpl.util.SessionHandle.getObjects(SessionHandle.java:334)
         at com.filenet.apiimpl.core.Session.callGetObjects(Session.java:121)
         at com.filenet.apiimpl.core.Session.executeGetObject(Session.java:325)
         at com.filenet.apiimpl.core.Session.getObject(Session.java:339)
         at com.filenet.apiimpl.core.IndependentObjectImpl.getObject(IndependentObjectImpl.java:154)
         at com.filenet.apiimpl.core.IndependentObjectImpl.refresh(IndependentObjectImpl.java:161)
         at com.filenet.api.core.Factory$Domain.fetchInstance(Factory.java:1543)
         at FileNetConnectionTest.testFileNetConnection(FileNetConnectionTest.java:69)
         at FileNetConnectionTest.main(FileNetConnectionTest.java:35)
    Plz help me out..Thank you

    I'm having the same problem.. I think there's something wrong with it. [fast weight loss tips|http://www.weightlossgidiet.com]

  • MS Olap connection with java api

    Hi,
    I am new to sql 2005 analytical server. How to connect to the sql 2005 analytical server using java programming language. If any one of you know please let me know details with some sample code

    If you are going to post code please use the code formatting tags. Select the code you are posting in the message box and click the CODE button.
    Your error is here
    Problem getting JAAS Context: java.lang.SecurityException: Unable to locate a login configurationYou should look into that.

  • Crystal Report Connectivity with Java

    How to connect our program with crystal report?

    I have never used crystal report. I have created a stand-alone application in java 6 with SQL server 2000 as backend. Its a simple application that maintains records of employees in an organization. I want to use crystal report for report generation. I have crystal report 9 on my system. I have searched a lot on google but could not find any relevant help. Can u provide help in this regard or send me links from where i could get any lead.
    I am not using any IDE as such now. Is it actually needed?
    Any help in this regard would be highly appreciated.

  • Oppening a dial up connection with Java

    How can I open a dial up connection using a java code ??

    i guess you should try
    String cmd = "c:\windows\dialup.exe";
    String envp [] = null; //environment variable
    Runtime.exec(cmd, envp);

  • Database connectivity with java!

    hello, has anyone got a "detailed" tutorial they can send on:
    1.setting up mySQL database (not just install)
    2.setting up J/connector (not just install)
    3.a tutorial on how i can get a servlet to interact with a client through a webpage!
    does it sound like i'm trying to learn how to do 5things at once? well your right... i want to start small, but i need to learn SQL to set up a database, and i need to j/connector to interact with the database.
    i'm less worriered about the third point at the moment, because there is a sun tutorial i've been looking at!
    any help would be more then appreciated!

    1.) use the mySQL documentation (it's not that bad)
    2.) see the j2ee tutorial (http://java.sun.com/j2ee/1.4/docs/tutorial/doc/ - chapter 11 is about servlets)
    3.) learn something about HTML and HTML formulars, your servlet could interpret the parameters transmitted from formulars (by HTTP GET, HTTP POST, ...)
    4.) discover the API documentation for the packages javax.servlet and javax.servlet.http to learn more about the possibilities
    5.) try it out (e.g. create a servlet which presents all the servlet parameters which are available: servlet information, request information, response information, ...)
    6.) have fun!
    hope it helps...

  • Flash connect with Java Web service

    I would like to develop a Flash UI communicating with Database. And i create a web service (in Java) that asking database
    to return a table.
    So i don't know why the datagrid in UI databind with the web service but it can't display / mapping with the return data.
    What databind type should i choose ? And what type or return value in the web service ? ( ResultSet / String Array, etc )

    Resolved when I create a deployement profile explicitly.
    The Webservice.deploy that gets created automatically when I create a web service was giving this issue.
    Thanks
    Saikrishna

  • MySQL Connectivity with Java

    I amusing Connector/j 3.0 for jdbc through MySQL.
    I am also using "org.gjt.mm.mysql.Driver"
    Please suggest how to set the classpath/path for mysql driver and where to put the driver,
    Please suggest with all configuration details.........

    http://www.dynamic-apps.com/tutorials/classpath.jsp

  • BerkelyDB with Java

    Hi,
    I want uses the Berkeley DB becouse I need HA(replication) in the my application, BerkeleyDB JE hasn´t this layer.
    Can I uses the HA layer of Berkeley DB doing connection with Java?

    Hi,
    I want uses the Berkeley DB becouse I need
    HA(replication) in the my application, BerkeleyDB JE
    hasn´t this layer.
    Can I uses the HA layer of Berkeley DB doing
    connection with Java?Hi Hugo,
    You can use Java with HA. There are some examples in your distribution:
    db-4.5.20\examples_java\src\db\repquote
    There is also a Getting Started Guide:
    http://www.oracle.com/technology/documentation/berkeley-db/db/gsg_db_rep/Java/index.html
    Ron Cohen
    Oracle Corporation

  • Connection refused with java, but not javaw

    I have a ServerSocket based program...listening on a port. It is really a very simple program. And I can run it with javaw. Then I can use another problem, for example, telnet to connect to that port, just to prove I can connect to that port. Everything is fine.
    Now if I run the exactly the same ServerSocket program with java, then I got the connection refused error.
    It is weird.
    Do you know why? Do you know a good socket troubleshooting tool on Windows? I am afraid of the viruses, so I haven't downloaded any free tools yet.

    You're right.
    The Norton personal firewall does not handle localhost to localhost correctly. I do all the tests on the same machine. The netstat -an shows the port is listening in either case. But now I know the firewall blocks one of them silently. No rule prompt was triggered. Worse, no logging produced for that particular access.
    Thanks. You've been very helpful.

  • Oracle 9i lite connection with a Java Client

    Hi,
    I would like to connect a Java Client developed using PersonalJava edition for PDA with an Oracle 9i lite version which is also on PDA.
    I would like to know is it possible to connect such a client (Java) using some JDBC drivers on PDA.
    if yes please do suggest a suitable driver and some input tips as to how to connect a GUI developed in Java directly to Oracle on PDA.
    I am not too sure whether some web/application server is required in the whole setup.
    because in N-Tier Architecture we have a middle layer of Application /Web servers in between a client screen(usually a Browser) and Database.
    but I am not aware weather it is possible to directly connect Java Swing or Client application as I mentioned above developed using Personal edition with a database using only some driver software but no other middle ware component in between.i.e forming a 2 tier client server model.
    please do let me know your valuable suggestions at [email protected]
    thanks,
    Ashish

    I connect to the database through the same user that created those tables. Do I still need a public synonym ?

  • Application deployed on Oracle Java Cloud Service - SaaS Extension is not connecting with cloud database.

    Hello Experts,
    I have deployed an ADF application on Oracle Java Cloud Service - SaaS Extension and also deployed database objects from local environment to cloud using JDeveloper. I can see the cloud database has tables and data which I have deployed but when I access the application it seems it is not able to connect with cloud database.
    I have followed below document and same sample application (HRSystem). 
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JDeveloperPart1/jdeveloperPart1.html
    http://www.oracle.com/webfolder/technetwork/tutorials/obe/java/JDeveloperPart2/jdeveloperPart2.html
    Please guide me what can be the issue.
    Regards
    Gulam Dyer

    Hi,
    Can you give us more details about your issue? Any error messages?
    Thanks,
    Bogdan

  • I just need a little help to connect with eCommerce API. Could anyone please give a JAVA sample code

    Hi All,
    I am looking for a sample code to just to connect with Business Catalyst eCommerce API. My aim is to simply retirieve the list of the products and update them.
    It would be really helpful, if anyone please provide me a sample code in JAVA, just to connect with the API.
    Thanks
    Ani

    public static void main(String[] args) throws RemoteException, MalformedURLException {
                        String endpoint = "https://CC.sys.com/CatalystWebS1ervice/CatalystEcommerceWebservice.asmx?WSDL"; // endpoint url can be found under Site Settings -> API -> click on eCommerce and copy the URL on the browser here.
                        CatalystEcommerceWebserviceSoapProxy sq = new CatalystEcommerceWebserviceSoapProxy(endpoint);
                        Products[] prod = new Products[2];
                        prod = sq.product_ListRetrieve(Username , Password, SiteID, CatalogueID);
                        System.out.println(prod[1].getDescription());

Maybe you are looking for