Interface program with JDBC

I created three database tables in PostgreSQL database and interfaced it with JDBC.
In the interface program, I queried the program to retrieve data from two tables. I got results from the first table, but did not get any result from the second table. Rather, the system sent the following error message: Exception in thread "main" java.sql.SQLException: ERROR: parser: parse error at or
near "mdas_ar_coments"
at org.postgresql.core.QueryExecutor.executeV2(QueryExecutor.java:289)
Mdas_ar_coments is the name of the second table. I have checked the names, there is no spelling mistake in both the database tables and interface program.
Please, let me know how to query two or more tables in a JDBC interface program.
Thanks.

Please show me how you are attempting to query two tables using JDBC.

Similar Messages

  • RMI with  JDBC program

    i want a program RMI with JDBC code included.

    Java RMI programs for implementing Author Registration.
    /* File Name : AuthorServerint.java
    Java Remote Interface for implementing Author Registration
    import java.rmi.*;
    public interface AuthorServerint extends java.rmi.Remote
              public void Update_Details(String autid, String name,String
                   title,String street, String city, String state, int pin)
                   throws java.rmi.RemoteException;
    File Name : AuthorServerimpl.java
    Java Interface implementation and Server program for implementing
    Author Registration
    import java.rmi.*;
    import java.sql.*;
    import javax.swing.*;
    public class AuthorServerimpl extends java.rmi.server.UnicastRemoteObject
              implements AuthorServerint
              static Connection con;
              static PreparedStatement ps;
              static ResultSet rs;
              static Statement st;
              int in;
              public AuthorServerimpl() throws java.rmi.RemoteException
                   super();
              public static void main(String args[])throws Exception
                   try{
                        AuthorServerint As=new AuthorServerimpl();
                        Naming.rebind("rmi://localhost/As",As);
                        System.out.println("Server ready");
              catch(Exception e){
                   System.out.println(e);
         public void Update_Details(String autid, String name,String
                   title,String street, String city, String state, int pin)
                   throws java.rmi.RemoteException
                   try{
                        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                        con=DriverManager.getConnection("Jdbc:Odbc:data");
                        st=con.createStatement();
                        if(autid.equals("") || name.equals("") || title.equals("") ||
                             street.equals("") || city.equals("") || state.equals(""))
                             JOptionPane.showMessageDialog(null,"Fill all the entries");
                        else{
                             in=st.executeUpdate("insert into Author values ('" autid
                                  "','"+name+"','"+title+"','"+street+"','"+ city+
                                  "','"+state+"','"+pin+"')");
                             if(in>0){          
                                  JOptionPane.showMessageDialog(null,"Data Updated");
                   catch(Exception e){}
    File Name : Authorclient.java
    Java Client program for implementing Author Registration
    import java.rmi.*;
    import java.io.*;
    import java.rmi.Naming;
    import java.sql.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.applet.*;
    public class Authorclient extends JFrame implements ActionListener
              static JTextField tautid,tname,ttitle,tstreet,tcity,tstate,tpin;
              JLabel lautid,lname,ltitle,lstreet,lcity,lstate,lpin;
              static JButton Badd,Exit,Bclear;
              String autid,name,title,street,city,state;
              int pin;
              Authorclient()
                   Container C=getContentPane();
                   C.setLayout(new GridLayout(9,2));
                   lautid=new JLabel("Author Id");
                   lname=new JLabel("Author Name");
                   ltitle=new JLabel("Title");
                   lstreet=new JLabel("Street");
                   lcity=new JLabel("City");
                   lstate=new JLabel("State");
                   lpin=new JLabel("Pincode");
                   tautid=new JTextField(10);
                   tname=new JTextField(10);
                   ttitle=new JTextField(10);
                   tstreet=new JTextField(10);
                   tcity=new JTextField(10);
                   tstate=new JTextField(10);
                   tpin=new JTextField(10);
                   Badd=new JButton("SUBMIT");
                   Exit=new JButton("EXIT");
                   Bclear=new JButton("CLEAR");
                   Badd.addActionListener(this);
                   Exit.addActionListener(this);
                   Bclear.addActionListener(this);
                   C.add(lautid);
                   C.add(tautid);
                   C.add(lname);
                   C.add(tname);
                   C.add(ltitle);
                   C.add(ttitle);
                   C.add(lstreet);
                   C.add(tstreet);
                   C.add(lcity);
                   C.add(tcity);
                   C.add(lstate);
                   C.add(tstate);
                   C.add(lpin);
                   C.add(tpin);
                   C.add(Bclear);
                   C.add(Badd);
                   C.add(Exit);
                   setVisible(true);
                   resize(300,300);
         public void actionPerformed(ActionEvent ae)
                   if(ae.getActionCommand().equals("SUBMIT"))
                        try{
                             AuthorServerint A=(AuthorServerint)Naming.lookup ("rmi://
                                  localhost/As");
                             autid=tautid.getText();
                             name=tname.getText();
                             title=ttitle.getText();
                             street=tstreet.getText();
                             city=tcity.getText();
                             state=tstate.getText();
                             pin=Integer.parseInt(tpin.getText());
                             A.Update_Details(autid,name,title,street,city,state,pin);
                        catch(Exception E){}
                   else if(ae.getActionCommand().equals("EXIT"))
                        System.exit(0);
                   else if(ae.getActionCommand().equals("CLEAR"))
                        tautid.setText("");
                        tname.setText("");
                        ttitle.setText("");
                        tstreet.setText("");
                        tcity.setText("");
                        tstate.setText("");
                        tpin.setText("");
         public static void main(String args[])
                   new Authorclient();
    note: this program is done using swing components and need a database to run. The fields of the table("Author") database("data") are the same as the variable used in "Update_Details" function.
    Edited by: Amar on Oct 30, 2007 12:11 PM

  • Interface labview program with real appliances

    How do i interface labview program with real life appliances. For example: interface with light bulb

    I suppose you could also find some kind of adapter to turn it into an IP based appliance and you could control it through the ethernet.  Or you could wait a few decades and interface LabVIEW 2059 with your cranial implant to directly control your light bulb. 
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Interfacing a java program with hardware

    I need to be able to interface a java program
    with data in the parallel or serial ports of the computer.
    I have no idea how to go about this, could someone please help me.
    Thanks

    http://java.sun.com/products/javacomm/

  • Need an example of server / client program with swing interface

    Hi!
    After a lot of trying i still haven't managed to create a server client program using swing components ...
    can someone write a mini application to demonstrate how this can be done?
    i would like to have a frame with a button a texField for input and a textAread for the output
    What i have in mind is the following ..
    say im the server
    i write something in the textField and then i press the button
    then the information written in the textFiled is passed to the client who shows it in his textArea
    The same thing goes on with the client (he can write something in his own textField and when he presses the button the info is passed at the
    server who puts it in his textArea) and vice versa.
    i have written many classes that trying unsuccessfully to do that ... below i show my last attempt ...
    I would appreciate if you could write a small application which it could to this.
    The whole idea is to create a turn based game ( i have implemented the game engine and graphics and i try to add the internet function)
    Here is the code ...( i would appreciate if you write a new code instead of trying to correct mine ( which i think it's impossible) in order to use it as a general example)
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    @SuppressWarnings("serial")
    *  In order to have a more gereral program instead of passing strings between the server
    *  and the client a pass an MyObjext object.  The MyObject class has an integer and a String
    *  (which is always the same) field . At the textField i write an integer number and i
    *  make a new MyObject which i want to pass to the server or the client and vice versa.
    *  The textArea shows the integer value of the MyObject which was passed from the server /client
    public class MyUserInterface extends JFrame {
         MyObject returnObject;
         JTextField myTextField;
         JTextArea te ;
         ClientGame cg;
         ServerGame sg;
          * used to determine if the current instance is running as a client or host
         boolean isHost;
         //The constructor of the client
         public MyUserInterface(ClientGame cg){
              this("Client");
              this.cg = cg;
              isHost = false;
         //The constructor of the server
         public MyUserInterface(ServerGame sg){
              this("Server");
              this.sg = sg;
              isHost = true;
         //The general constructor used both by client and server ..
         // it initializes the GUi components and add an actionListenr to the button
         public MyUserInterface(String str) {
              super(str);
              myTextField = new JTextField(2);
              te = new JTextArea();
              te.setPreferredSize(new Dimension(100,100));
              JButton okButton = new JButton("Ok");
              okButton.addActionListener(new ActionListener() {
                   @Override
                   public void actionPerformed(ActionEvent e) {
                        try{
                             int a = Integer.parseInt(MyUserInterface.this.myTextField.getText());
                             System.out.println(a);   //used to control the flow of the program
                                  MyUserInterface.this.returnObject = new MyObject(a);
                             //sends the data
                             sendData();
                             //waiting for response...
                             getData();
                             catch(Exception ex){System.out.println("Error in the UI action command" +
                                                                ex.printStackTrace();}
              JPanel panel =  new JPanel(new FlowLayout());
              panel.add(okButton);
              panel.add(myTextField);
              panel.add(te);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              getContentPane().add(panel);
              pack();
              setVisible(true);
         protected MyObject getReturnObject() {
              return returnObject;
         public void sendData(){
              new Thread(new Runnable() {
                   @Override
                   public void run() { 
                        if (!isHost)cg.sentData(returnObject);    //using the Servers out and in methods
                        else sg.sentData(returnObject);                    //using the Clients out and in methods
                        System.out.println("data sending");
         public MyObject getData(){
              MyObject obj;
              System.out.println("Retrieveing Data");
              if (!isHost)obj = (MyObject)cg.getData();
              else obj = (MyObject)sg.getData();
              System.out.println(" data retrieved  = "+ obj.getInt());  //just to control how the code flows
              te.setText(obj.getInt()+"");       
              return obj;
         public static void main(String[] args) {
              *Initiating the Server
              new Thread(new Runnable() {
                   @Override
                   public void run() {
                        ServerGame sg = new ServerGame();
                        new MyUserInterface(sg);
              }).start();     
               * Initiating the Client
              new Thread(new Runnable() {
                   @Override
                   public void run() {
                        ClientGame cg = new ClientGame("192.168.178.21");   //<----in case you run my code
                                                                          //..don't forget to change to your
                        new MyUserInterface(cg);                              //ip
              }).start();
    import java.io.*;
    import java.net.*;
    public class ClientGame {
         String ipAddress;
         Socket clientSocket = null;
        ObjectOutputStream out = null;
        ObjectInputStream in = null;
         public ClientGame(String ipAddress) {
              this.ipAddress = ipAddress;
              try {
                   System.out.println("Connecting To Host");
                 clientSocket = new Socket(InetAddress.getByName(ipAddress),4444);
                System.out.println("Host Found ...Io initializaton");
                out = new ObjectOutputStream(clientSocket.getOutputStream());
                in = new ObjectInputStream(clientSocket.getInputStream());
            } catch (UnknownHostException e) {
                System.err.println("Don't know about host: taranis.");
                System.exit(1);
            } catch (IOException e) {
                System.err.println("Couldn't get I/O for the connection to: taranis.");
                System.exit(1);
         public Object getData(){
              Object fromServer = null ;
              do{
                 try {
                      fromServer = in.readObject();
                 catch(ClassNotFoundException ex){}
                  catch(IOException e){}
              }while(fromServer==null);
              return fromServer;        
         public void sentData(final Object obj){
              new Thread(new Runnable() {
                   @Override
                   public void run() {
                        try{
                             out.writeObject(obj);
                        catch(IOException e){}
              }).start();
         public void terminateConnection(){
              try{
                   out.close();
                   in.close();
                   clientSocket.close();
              catch (IOException e){}
    public class ServerGame {
         ServerSocket serverSocket;
         Socket clientSocket;
         ObjectOutputStream out = null;
        ObjectInputStream in = null;
         public ServerGame() {
              try{
                   serverSocket = new ServerSocket(4444);
                   clientSocket = serverSocket.accept();
                   out =  new ObjectOutputStream(clientSocket.getOutputStream());
                in = new ObjectInputStream(clientSocket.getInputStream());
              catch(IOException e){System.out.println("IOException in ServerGame");}
         public Object getData(){
              Object fromClient = null ;
              do{
                 try {
                      fromClient = in.readObject();
                 catch(ClassNotFoundException ex){}
                  catch(IOException e){}
              }while(fromClient==null);
             return fromClient;        
         public void sentData(final Object obj){
              new Thread(new Runnable() {
                   @Override
                   public void run() {
                        try{
                   out.writeObject(obj);
              catch(IOException e){}
              }).start();
         public void terminateConnection(){
              try{
                   out.close();
                   in.close();
                   clientSocket.close();
                   serverSocket.close();
              catch (IOException e){}
         public static void main(String[] args) {
              new ServerGame();
    import java.io.Serializable;
    * this is a test object
    * it has a String field and a value
    *  The string is always the same but the integer value is defined in the constructor
    public class MyObject implements Serializable{
         private static final long serialVersionUID = 1L;
         String str;
         int myInt;
         MyObject(int a){
              str = "A String";
              myInt = a;
         public int getInt(){
              return myInt;
    }

    Pitelk wrote:
    I believe that a good code example can teach you things ;that you would need many days of searching; in no timeSo lets write one small example.. Ill help a little, but you do most of the work.
    jverd approach is deffenetly the way to go.
    jverd wrote:
    * Write a very small, simple Swing program with an input area, an output area, and a button. When you click the button, what's in the input area gets copied over to the output area.This part is partially done.
    * Write a very small, simple client/server program without Swing. It should just send a couple of hardcoded messages back and forth.And this part is for you(Pitelk) to continue on. I cannot say that this is the best way. or that its good in any way. I do however like to write my client/server programs like this. And perhaps, and hopefully, Ill learn something new from this as well.
    This is how far I got in about 10-20min..
    package client;
    * To be added;
    * A connect method. That connects the client to the server and
    * opens up both the receive and transmit streams. After doing that
    * the an instance of the ServerListener class should be made.
    * Also an disconnect method could be usable. But thats a later part.
    public class TestClass1 {
    package utils;
    import java.io.ObjectInputStream;
    import client.TestClass1;
    * This class is meant to be listening to all responses given from
    * the server to the client. After a have received data from the
    * server. It should be forwarded to the client, in this case
    * TestClass1.
    public class ServerListener implements Runnable {
         public ServerListener(ObjectInputStream in, TestClass1 tc) {
         @Override
         public void run() {
              while(true) {
    package server;
    import java.io.ObjectOutputStream;
    import java.net.Socket;
    import java.util.ArrayList;
    import java.util.List;
    * This class should handle all data sent to the server from the clients.
    class Server implements Runnable {
         private static List<ObjectOutputStream> outStreams = new ArrayList<ObjectOutputStream>();
         private Socket client = null;
         public Server(Socket client) {
              this.client = client;
         @Override
         public void run() {
              while(true) {
    * The meaning of this class is to listen for clients trying to connect
    * to the server. Once connection is achieved a new thread for that client
    * should be made to listen for data sent by the client to the server.
    public class ChatServer implements Runnable {
         @Override
         public void run() {
              while(true) {
    package utils;
    import java.io.Serializable;
    @SuppressWarnings("serial")
    public class MyObject implements Serializable {
         private String mssg;
         private String clientID;
         private String clientName;
         public MyObject(String mssg, String clientID, String clientName) {
              this.mssg = mssg;
              this.clientID = clientID;
              this.clientName = clientName;
         //Generate getters and setters..
    }Continue on this, and when you get into problems etc post them. Also show with a small regular basis how far you have gotten with each class or it might be seen as you have lost intresst and then this thread is dead.
    EDIT: I should probably also say that Im not more than a java novice, at the verry most. So I cannot guarantee that I alone will be able to solve all the problems that might occure during this. But Im gonna try and help with the future problems that may(most likely will) occure atleast(Trying to reserve my self incase of misserable failiure from me in this attempt).
    Edited by: prigas on Jul 7, 2008 1:47 AM

  • With JDBC, calling a stored procedure with ARRAY as out parameter

    Hi,
    I want to use the data type ARRAY as an out parameter in an Oracle stored procedure. I want to call the stored procedure from
    my java program using JDBC.
    The problem it's i use a 8.1.7 client to acces with oci to a 7.1.3 Database.
    With this configuration I can get back a Cursor but not an Array.
    Does it's possible ?
    Thanks for your help !
    Michakl

    Originally posted by JDBC Development Team:
    It's very similar to other datatype except that it uses OracleTypes.ARRAY typecode and the value is mapped to a oracle.sql.ARRAY instance. The code looks as follows --
    cstmt.registerOutParameter (idx, OracleTypes.ARRAY, "VARRAY_TYPE_NAME_HERE");
    cstmt.execute ();
    ARRAY array = (ARRAY) cstmt.getObject (idx);
    Thanks for your reply.
    I have to use:-
    OracleCallableStatement cs1 = (OracleCallableStatement )conn.prepareCall
    ( "{call proj_array(?)}" ) ;
    for retrieving a collection as an OUT parameter.
    This gives me the errors:-
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Array getArray(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Clob getClob(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    C:\jdbc\VarraySQL.java:0: The method oracle.jdbc2.Ref getRef(int) declared in class oracle.jdbc.driver.OracleCallableStatement cannot override the method of the same signature declared in interface java.sql.CallableStatement. They must have the same return type.
    import java.sql.*;
    ^
    How do I get rid of these errors?
    null

  • RMI with JDBC

    Hello,
    this is the first time that I work with RMI.
    In fact it isn't so hard.
    But I've made an interface that do the operations on my database.
    Do I also have to program a locking mechanism?
    Does anybody made such a system, or what do you recommand.
    I want to make a simpel program that uses a database on another pc.
    tnx

    Hi Twims
    Im asking if you could make me a favor... As I can see you know RMI with JDBC... And at this moment I need a client and server programs to connect to a database, execute SQL commands and retrieve information to client.
    If you could send me those programs please do it to [email protected] or [email protected]
    Thanks in advance
    ANDRES GONZALEZ

  • I have a problem with JDBC Realm in Tomcat/Oracle/Win XP

    I have a problem with JDBC Realm in Tomcat.
    I have attached my server.xml file located in the
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\server.xml
    The Problem is that when I login I get the user name and password prompt but it does not resolve.
    When I enter in the tomcat-users.xml password with memory realm uncommented it works fine.
    C:\Program Files\Apache Software Foundation\Tomcat 5.5\conf\tomcat-users.xml
    Is there a cache or something I need to reset for the JDBC Realm to work?
    I have attached my tables and contents as well...
    Did I miss something????
    Thanks
    Phil
    server.xml
    <Server port="8005" shutdown="SHUTDOWN">
    <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
    <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
    <Listener className="org.apache.catalina.storeconfig.StoreConfigLifecycleListener"/>
    <!-- Global JNDI resources -->
    <GlobalNamingResources>
    <!-- Test entry for demonstration purposes -->
    <Environment name="simpleValue" type="java.lang.Integer" value="30"/>
    </GlobalNamingResources>
    <!-- Define the Tomcat Stand-Alone Service -->
    <Service name="Catalina">
    <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
    <Connector
    port="8080" maxHttpHeaderSize="8192"
    maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
    enableLookups="false" redirectPort="8443" acceptCount="100"
    connectionTimeout="20000" disableUploadTimeout="true" />
    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="8009"
    enableLookups="false" redirectPort="8443" protocol="AJP/1.3" />
    <!-- Define the top level container in our container hierarchy -->
    <Engine name="Catalina" defaultHost="localhost">
    <!--
    <Realm className="org.apache.catalina.realm.MemoryRealm" />
    -->
    <Realm className="org.apache.catalina.realm.JDBCRealm"
    driverName="oracle.jdbc.driver.OracleDriver"
    connectionURL="jdbc:oracle:thin:@localhost:1521:orcl"
    connectionName="testName" connectionPassword="testPass"
    userTable="users"
    userNameCol="user_name"
    userCredCol="user_pass"
    userRoleTable="user_roles"
    roleNameCol="role_name" />
    <!-- Define the default virtual host
    Note: XML Schema validation will not work with Xerces 2.2.
    -->
    <Host name="localhost" appBase="webapps"
    unpackWARs="true" autoDeploy="true"
    xmlValidation="false" xmlNamespaceAware="false">
    </Host>
    </Engine>
    </Service>
    </Server>
    Tables
    create table users
    user_name varchar(15) not null primary key,
    user_pass varchar(15) not null
    create table roles
    role_name varchar(15) not null primary key
    create table user_roles
    user_name varchar(15) not null,
    role_name varchar(15) not null,
    primary key( user_name, role_name )
    select * from users;
    ----------------------+
    | user_name | user_pass |
    ----------------------+
    | tomcat | tomcat |
    | user1 | tomcat |
    | user2 | tomcat |
    | user3 | tomcat |
    ----------------------+
    select * from roles;
    | role_name |
    | tomcat |
    | role1 |
    select * from user_roles;
    -----------------------+
    | role_name | user_name |
    -----------------------+
    | tomcat | user1 |
    | role1 | user2 |
    | tomcat | tomcat |
    | role1 | tomcat |
    -----------------------+

    Jan 2, 2008 11:49:35 AM org.apache.coyote.http11.Http11Protocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Jan 2, 2008 11:49:35 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 734 ms
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.9
    Jan 2, 2008 11:49:35 AM org.apache.catalina.realm.JDBCRealm start
    SEVERE: Exception opening database connection
    java.sql.SQLException: oracle.jdbc.driver.OracleDriver
         at org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:684)
         at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:758)
         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1004)
         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
         at org.apache.catalina.core.StandardService.start(StandardService.java:450)
         at org.apache.catalina.core.StandardServer.start(StandardServer.java:683)
         at org.apache.catalina.startup.Catalina.start(Catalina.java:537)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:271)
         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:409)
    Jan 2, 2008 11:49:35 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Jan 2, 2008 11:49:36 AM org.apache.catalina.core.StandardContext resourcesStart

  • What html code will start an EXE (program) with a click on a webpage link?

    The code in bold below worked. After I switched my browser from IE 11 to Firefox to get the hover on hotspots to work, the program gave me this error message. I moved the EXE file to my local file folder and tried it as shown below. Still no success. Any suggestions?
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Family Tree Charts</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
    <!--
    body,td,th {
        color: #000;
    -->
    </style></head>
    <body link=blue vlink=blue>
    <table width="100%" height="25" border="0" cellpadding="4" cellspacing="0">
      <tr>
        <td width="93%" height="27" bgcolor="#EFEFEF"> <div align="center"><font color="#999999">
        <b>This Software Allows You To Review Neat Charts of Your Family Tree </b></font></div></td>
        <td width="7%" bgcolor="#CCFFFF"> <div align="center"><A href="Mementos_Menu.html"><font size="2">Back</font></a></div></td>
      </tr>
    </table><BR><center>
    <br>
    <FONT color=#ff00ff><strong>Click the link below to download a special software program for your PC.</strong></FONT><br>
    <br>
    <a href="http://jdmcox.com/"><strong>Cox Website</strong></a><br><br>
    <strong>ITEM 1</strong> (AT THIS  WEBSITE) IS  THE <strong>FAMILY TREE CHART</strong> PROGRAM.<br>
    It is called <strong>Simple Family Tree</strong><br>
    <table width="80%" border="2" cellspacing="2" cellpadding="2">
      <tr>
        <td width="49%" align="left" valign="top"><FONT color=#ff00ff><strong>Click the link below to use this special software program after you download and install the program.</strong></FONT><br>
    <br>
    <!--<a href="C:\Program Files (x86)\Simple Family Tree\Simple Family Tree.exe"><strong>Family Tree Charts Program by Doug Cox</strong></a><br><FONT color=#ff00ff>
    -->
    <a href="C:\Users\Tom and Polly\Documents\Genealogy CD\Simple Family Tree\Simple Family Tree.exe"><b>Family Tree Charts Program</b></a><br><br>
    <FONT color=#ff00ff><strong>Click  the &quot;run&quot; button for both warning messages.<br>
    Click the &quot;READ THIS!&quot; menu option when the program opens.<br>
    Click  "X" in the upper right to close the program.<br><br>
    You can update the family data in future years with this program too.</strong></FONT>
    <br></td>
        <td width="51%" align="left" valign="top"><FONT color=#ff00ff><strong>NOTE 1: Be sure your HTML code for this webpage has a proper line to link to the location where the software was installed. You can use NOTEPAD to make HTML code changes. My existing line is: </strong></FONT><br>
          "c:\<u>program files (x86)</u>\simple family tree\simple family tree.exe"<br><br>
          <FONT color=#ff00ff><strong>The underlined portion will need to agree with where the program was installed. Just change the directory (see underlined sample above). Good luck. If I am still living, call me.<br><br>
          NOTE 2: After you download, install, and try to use the program, you may get an error message window that looks like this -&quot;0 FAMS @F191 @ FAM&quot;. This means you have an individual record in your GEDCOM file that does not have a parent. Be sure all GEDCOM records have at least one parent even if you must name the parent UNKNOWN.</strong></FONT></td>
      </tr>
    </table>
    <br></center> 
    <table width="100%" border="0" cellpadding="2" cellspacing="0" bgcolor="#CCCCCC">
        <tr>
          <td bgcolor="#EFEFEF"> <font size="2">&copy;2002 Sales and People</font></td>
        </tr>
    </table></body>
    </html>

    Herbert:
    Here is my latest code attempt, but I get messages about the lines in BOLD that I do not understand.
    Perhaps you will see what I need to fix. Sure appreciate what you have found and shared with such a neophyte (aka dumbo).
    Tom
    <!--
    body,td,th
    -->
    function RunExe(path) {
    try {
    var ua = navigator.userAgent.toLowerCase();
    if (ua.indexOf("msie") != -1) {
    MyObject = new ActiveXObject("WScript.Shell")
    MyObject.Run(path);
    } else {
    netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
    var exe = window.Components.classes['@mozilla.org/file/local;1'].createInstance(Components.interfaces.nsILocalFile);
    exe.initWithPath(path);
    var run = window.Components.classes['@mozilla.org/process/util;1'].createInstance(Components.inteinterfaces.nsIProcess);
    run.init(exe);
    var parameters = ["/c start Simple Family Tree.exe"];
    run.run(false, parameters, parameters.length);
    } catch (ex) {
    alert(ex.toString());
    This Software Allows You To Review Neat Charts of Your Family Tree
    Back
    Click the link below to download a special software program for your PC and your GED file.
    *Cox Website*
    ITEM 1 (AT HIS  WEBSITE) IS  HIS FAMILY TREE CHART PROGRAM.
    It is called Simple Family Tree
    Click the link below to look at my GEDCOM file contents.<br>Instructions are provided in the READ THIS menu option at the top of the window.
      *Show Yarnall Chart*
    *Return to this webpage by clicking on the backarrow after looking at the chart.
    You can update the family data in future years with this program too.*
    ©2002 Sales and People
    Date: Thu, 2 Jan 2014 02:09:18 -0800
    From: [email protected]
    To: [email protected]
    Subject: What html code will start an EXE (program) with a click on a webpage link?
        Re: What html code will start an EXE (program) with a click on a webpage link?
        created by Herbert2001 in Dreamweaver support forum - View the full discussion
    Perhaps this might be helpful:
    https://addons.mozilla.org/en-US/firefox/addon/opendownload-10902/
    It allows executables in Firefox to be run - it is an extenstion, though, so it must be installed in Firefox before your page will work.
    Another option is this solution, but it will still require a manual change in Firefox:
    http://forums.mozillazine.org/viewtopic.php?f=19&t=803615
    Or this: http://stackoverflow.com/questions/6472435/running-exe-in-firefox-why- do-i-get-an-error
    However, you will still have problems with getting it to work cross-browser. Honestly, browsers are not supposed to have access like that to the client side file system, which absolutely makes sense for the web.
    That is why you may have to approach the solution from a different angle - perhaps create a server side cloud version of your application(s) which can be easily accessed and run by your family members. I believe you used C to develop the applications? Although I have no experience with this framework, Wt might be a solution to convert your projects to server side applications:
    http://www.webtoolkit.eu/wt
    Good luck!
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5972893#5972893
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5972893#5972893
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5972893#5972893. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Dreamweaver support forum at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Problem with JDBC and Tomcat

    I don't know where the problem originate, the only thing in my memory is that the program worked very well on my PC yesterday, but today, without even slightest change, it doesn't work anymore. As to debug it, I simplified the codes to the least, but it still refuse to work. I was beaten down by this problem totally, and cannot make out any solution for it, so, I come here, hoping to find a warrior to kill this damned bug for me.
    My program is a Servlet, but for the purpose of debugging, I have recode it to an Application/Servlet. When run as a application, I can get the result expected, but as a Servlet, :-(, maybe you should see it by yourself. My server software is Tomcat 4.1.15, and the JDK version is 1.4.0. To excute this program, you should add Data Source "Test" to ODBC.
    ///////////////////////code begins/////////////////////////
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Ex extends HttpServlet
         int ErrorType = 0;
         String err = new String("");
         public static void main(String args[]) throws Exception{
              Ex cEx = new Ex();
              cEx.init();     
              System.out.println(cEx.ErrorType);     
         public void init() {
              String url = "jdbc:odbc:Test";
              ErrorType = 3;     //passed
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              } catch (ClassNotFoundException e) {
                   e.printStackTrace();
                   ErrorType = 1; //trapped in Class.forName
              try{
                   Connection c = DriverManager.getConnection(url);
              } catch (SQLException e) {
                   e.printStackTrace();
                   ErrorType = 2; //trapped in DriverManager.getConnection
                   err = e.getMessage();
         public void service(HttpServletRequest req, HttpServletResponse res)
                   throws IOException {
              res.setContentType("text/html; charset=GB2312");
              PrintWriter out = res.getWriter();
              out.println("Success " + "<p>" + ErrorType + "<p>" +err);
              out.close();
    //////////////////////////code ends///////////////////////////////
    The result from the Servlet tell me that the problem occurred within the connection process, I don't know who should be responsible to this - Tomcat or JDBC?

    If you could print the exception that you got then that would help :) In the mean time, I could make a guess. It is unlikely that your application server (in this case, Tomcat) is blocking connections from your servlet. So the problem is either with JDBC directly or with the underlying datasource. It seems unlikely that it is JDBC given that you have stated that the code has not changed and it works in application form.
    My guess would be that you are coming up against some sort of security constraint (eg: your DBMS is letting you log in from one IP but not another?, your Java plug-in security policy is disallowing the connection?). It's hard to say.
    But if it works as an application but not via a servlet then you could try putting this in your java.policy file, which is located in the directory where your plug-ins are installed (eg: "C:\Program Files\Java\<version>\lib\security\") on Windows systems;
    permission java.net.SocketPermission "bend xp:1099", "listen,connect,accept";
    Try that, see if it works :)
    Ben

  • Payables Open Interface Program Source Problem

    Hello All,
    I am trying to import invoice using "Payable Open Interface Program".
    I have two Sources from which I am uploading invoices.
    Lets say the Sources be A and B. (in the lookup code i have added A and B under Source lookup type).
    Now the problem is Payables program is importing successfully for Source A and the program is erroring out for source B.
    Can u suggest me what could be the problem here?
    Is there any other setup required with respect to sources need to be done?
    Thanks & Regards
    Aboothahir

    hello all,
    I am able to upload the invoices now using both the sources.The problem was with source B i was not passing the group name. so i passed the group name and the records are getting uploaded.
    thanks & regards
    aboothahir

  • Outbound interface program for downl;oading text file

    Hi,
    I m working with outbound interface program which downloads text file into application and presentation server upon the selection.
    My probelm is
    The data format in the text file
    Whenever interface sends 1 record to the text file and next record should start continuation to the first record with
    seperator like some synbol.
    Please tel me posr the sent for this

    Hi,
    I m working with outbound interface program which downloads text file into application and presentation server upon the selection.
    My probelm is
    The data format in the text file
    Whenever interface sends 1 record to the text file and next record should start continuation to the first record with
    seperator like some synbol.
    Please tel me posr the sent for this

  • BUG JSF h:dataTable with JDBC ResultSet - only last column is updated

    I tried to create updatable h:dataTable tag with three h:inputText columns with JDBC ResultSet as data source. But what ever I did I have seceded to update only the last column in h:dataTable tag.
    My JSF page is:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1250"/>
    <title>Stevan</title>
    </head>
    <body><h:form>
    <p>
    <h:messages/>
    </p>
    <p>
    <h:dataTable value="#{tabela.people}" var = "record">
    <h:column>
    <f:facet name="header">
    <h:outputText value="PIN"/>
    </f:facet>
    <h:inputText value="#{record.PIN}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Surname"/>
    </f:facet>
    <h:inputText value="#{record.SURNAME}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:inputText value="#{record.NAME}"/>
    </h:column>
    </h:dataTable>
    </p>
    <h:commandButton value="Submit"/>
    </h:form></body>
    </html>
    </f:view>
    My java been is:
    package com.steva;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class tabela {
    private Connection conn;
    private ResultSet resultSet;
    public tabela() throws SQLException, ClassNotFoundException {
    Statement stmt;
    Class.forName("oracle.jdbc.OracleDriver");
    conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
    stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
    public ResultSet getPeople() {
    return resultSet;
    I have instaled “Oracle Database 10g Express Edition Release 10.2.0.1.0” – product on my PC localy. I have enabled HR schema and I have instaled and pupulated with sample data folloving table:
    CREATE TABLE "PERSON"
    (     "PIN" VARCHAR2(20) NOT NULL ENABLE,
         "SURNAME" VARCHAR2(30),
         "NAME" VARCHAR2(30),
         CONSTRAINT "PERSON_PK" PRIMARY KEY ("PIN") ENABLE
    I have:
    Windows XP SP2
    Oracle JDeveloper Studio Edition Version 10.1.3.1.0.3894
    I am not shure why this works in that way, but I think that this is a BUG
    Thanks in advance.

    Hi,
    I am sorry because of formatting but while I am entering text looks fine but in preview it is all scrambled. I was looking on the Web for similar problems and I did not find anything similar. Its very simple sample and I could not believe that the problem is in SUN JSF library. I was thinking that problem is in some ResultSet parameter or in some specific Oracle implementation of JDBC thin driver. I did not try this sample on any other platform, database or programming tool. I am new in Java and JSF and I have some experience only with JDeveloper.
    Java been(session scope):
    package com.steva;
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    public class tabela {
    private Connection conn;
    private ResultSet resultSet;
    public tabela() throws SQLException, ClassNotFoundException {
    Statement stmt;
    Class.forName("oracle.jdbc.OracleDriver");
    conn = DriverManager.getConnection
    ("jdbc:oracle:thin:@localhost:1521:xe", "hr", "hr");
    stmt = conn.createStatement
    (ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE);
    resultSet = stmt.executeQuery("SELECT PIN, SURNAME, NAME FROM PERSON");
    public ResultSet getZaposleni() {
    return resultSet;
    JSF Page:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ page contentType="text/html;charset=windows-1250"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:view>
    <html>
    <head>
    <meta http-equiv="Content-Type"
    content="text/html; charset=windows-1250"/>
    <title>Stevan</title>
    </head>
    <body><h:form>
    <p>
    <h:messages/>
    </p>
    <p>
    <h:dataTable value="#{tabela.zaposleni}" var = "record">
    <h:column>
    <f:facet name="header">
    <h:outputText value="PIN"/>
    </f:facet>
    <h:inputText value="#{record.PIN}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Surname"/>
    </f:facet>
    <h:inputText value="#{record.SURNAME}"/>
    </h:column>
    <h:column>
    <f:facet name="header">
    <h:outputText value="Name"/>
    </f:facet>
    <h:inputText value="#{record.NAME}"/>
    </h:column>
    </h:dataTable>
    </p>
    <h:commandButton value="Submit"/>
    </h:form></body>
    </html>
    </f:view>

  • How to used the unicode in   interface program in sap abap

    hi expect,
          can any body give example how to convert the non-unicode into unicode in a interface program.please help me.

    First check the connection with the source system. If its ok then replicate the datasource and activate. Then try with running job.
    Time stamp error usually happens when source system in BI and r/3 side differs.

  • Interface program to transmit billing docs as edi 810

    Hi experts,
        I am new to ale/edi/idocs. I need to develop an interface program to transmit billing documents in a text file for sending them as edi 810 docs. Can anyone give me some idea on how to deal with this?
    Thanks a lot...
    Regards,
    Abhinav
    Message was edited by:
            Neo

    thanks karthikeyan...but i need help in the part after message control configuration in the edi outbound process...

Maybe you are looking for