Problems in Retrieve Server's Data from Client through RMI

//I feel that this question quite challenging for me. maybe it is easy for you all. anyway, so anybody if know it, pls point out my mistake and give some opinion on my programs.thanks....
/*I have written one retrieve method in my server that is going to
be called by the client�s pc. But I am facing the error when
running
it. The error is � SQL Error in retrieve statemet:
[Microsoft][ODBC
Microsoft Access
Driver] Data type mismatch in criteria expression.� So anybody
know
where is my mistakes? Is it my server retrieveData method wrong? Or
my client is calling not properly? Thanks.
Actually my expected result is when client pc input the particular
staff id , then the client textfield will show all the information
of that particular staff according to the input id to the client
interface text field. */
******************* Interface *****************************
public interface RemoteDBServer extends
java.rmi.Remote //RemoteDBServer interface
     public String retrieveData(String idd, String ln, String
fn, String op, String oe, String hp, String ps, String ss) throws
java.rmi.RemoteException;
*************** Server Program ***********************************
//id, last_name, first_name, office_phone, office_ext��..is a
table�s attribute name
//the jdbc and odbc path already been set in control panel �
administrative tools.
public String retrieveData(String idd) throws
java.rmi.RemoteException
          String result=" ";
          try
          //create a statement
          Statement statement = connection.createStatement();
     String sql="SELECT * FROM emp_overview WHERE id ='"+idd+"'";
          //execute quury and capture results
          ResultSet rs = statement.executeQuery(sql);
          rs.next();
               String ln = rs.getString("last_name");
               String fn = rs.getString("first_name");
               String op = rs.getString("office_phone");
               String oe = rs.getString("office_ext");
               String hp = rs.getString("home_phone");
               String ps = rs.getString("primary_skill");
          String ss = rs.getString("secondary_skill");
               statement.close();
          catch (SQLException sqlex)
     System.out.println("SQL Error in retrieve statement: "
+sqlex);
          sqlex.printStackTrace();
     return result;
****************************Client Program ************************
..............����
//findName already declared in JButton
//tln, tfn, top, toe�..already declared in JTextField
else if (event.getSource() == findName)
               try
                    db.retrieveData(tid.getText());
                    tln.setText("");
                    tfn.setText("");
                    top.setText("");
                    toe.setText("");
                    thp.setText("");
                    tps.setText("");
                    tss.setText("");
               catch(Exception e)
          System.out.println ("Cant delete to server " + e);

Hi Kevin,
It looks like your id field is of Numeric datatype and you are wrapping it with single quotes in your query, which is not correct.
Your wrote :
String sql="SELECT * FROM emp_overview WHERE id ='"+idd+"'";
If id is of type numeric data type then, use:
String sql="SELECT * FROM emp_overview WHERE id ="+idd;
regards,
Humayun

Similar Messages

  • Error 61 when sending data from client and back from server.vi

    Trying to generate and send a data from client.vi and adding the numbers generated and sending it back to the client .In client the data is received only once and an error 61 occurs .How do I get rid of this error?I have attached the two files for reference
    Attachments:
    Sguruserver.vi ‏63 KB
    client1.vi ‏100 KB

    You can certainly use and application started by WebStart to send data to a server.
    However, the Sandbox restrictions allow you to contact the server the application was loaded from without asking for permission first (i.e. signing your application and requesting the proper permissions in your JNLP file).
    The JNLP BasicService can be used to retrieve the URL (and therefore the server) the application was loaded from.

  • Retrieve specific range data from oracle table

    Hi, Dear friends,
    I want to retrieve all the data from oracle table and then save them to mysql table using JDBC ResultSet. The problem is that some oracle table is too big, if I retrieve all of them to memory at a once time using excuteQuery, the program will become no response out of memory limitation. So my question is if I can retrieve just specific range data once a time. I can¡¯t find this function through JDBC API. Also, I don¡¯t want to use the specific sql sentence, for example ¡°select ¡ from¡ where someid>¡ and someid<¡¡±, because there are many different tables, I want to transfer them automatically. So I can¡¯t construct such sql sentence in advance. Does anyone know if oracle JDBC driver provide such kind of function or does there any other way?
    Any suggestion will be greatly appreciated!
    Sammy

    Dear Justin,
    thank you so much for your prompt reply!
    as your suggestion, I do check the performance while my program is running, after the program become nearly no response, I found the memory usage is nearly 100%, while disk usage and process usage is pretty low. that's the reason why I guess maybe the memory limitation, but the strange thing is that no any error reported by JBuilder, it just nearly no response and don't transfer any data any more. my os is windows xp, the version of JBuilder is 7. my main memory is 768M. just as you said, the total 6,000 records in not very large, just no more than 400K. another strange thing is that why my program works well when there is little data records in the table.
    the big picture of my program is first I retrieve oracle table metadata, according to this information, I construct DDL sql words and then create the corresponding table in mysql database. this part works well. in order to save your time, I will not paste the code here. then there is a method to transfer oracle data to mysql table, whenever creating the mysql table, then I will call this method to transfer datat to it. the following is the code of this method, I am very sorry to take your time. please read it when you are available.
    thank you very much!!
    Sammy
    //transfer data from oracle to mysql!!!
    private static void transferData(Connection oracleConn, Connection mysqlConn, String oracleTableName, String oracleSchemaName) throws SQLException{
    Statement oracleStmt=oracleConn.createStatement();
    Statement mysqlStmt=mysqlConn.createStatement();
    // sending sql to oracle to retrieve data
    String thisTableName=oracleTableName;
    String oracleSQL="SELECT * FROM ".concat(thisTableName);
    ResultSet oracleRS = oracleStmt.executeQuery(oracleSQL);
    String sql="";
    if (oracleRS.next()) {
    ResultSetMetaData rsmd = oracleRS.getMetaData();
    int colCount = rsmd.getColumnCount();
    do {
    String sqlBodyPart="";
    String sqlValuePart="";
    System.out.println("the number of column is "+colCount);
    for (int i = 1; i <= colCount; i++) {
    String columnValue = oracleRS.getString(i);
    boolean b = oracleRS.wasNull();
    String columnName =rsmd.getColumnName(i);
    System.out.println("the value of column " + i + "is " + columnValue);
    //construc the sql body part and value part
    sqlBodyPart=sqlBodyPart.concat(" ").concat(columnName).concat(",");
    if(b){ //if the value of the column i is null
    sqlValuePart=sqlValuePart.concat(" null").concat(",");
    }else{
    sqlValuePart=sqlValuePart.concat(" '").concat(columnValue).concat("',");
    //get rid of the last comma in sqlBodyPart and sqlValuePart
    if(!sqlBodyPart.equalsIgnoreCase("")) sqlBodyPart=sqlBodyPart.substring(0,sqlBodyPart.length()-1);
    if(!sqlValuePart.equalsIgnoreCase("")) sqlValuePart=sqlValuePart.substring(0,sqlValuePart.length()-1);
    //construct the sql sentence!!!
    sql="INSERT INTO ".concat(thisTableName).concat(" (").concat(sqlBodyPart).concat(") ").concat(" VALUES(").concat(sqlValuePart).concat(")");
    System.out.println("the sql words for this column is");
    System.out.println(sql);
    System.out.println(" ");
    if(mysqlStmt!=null){
    int rows = mysqlStmt.executeUpdate(sql);
    } else{
    System.out.println("can't connect with mysql server");
    System.exit(1);
    while (oracleRS.next());
    } else {
    System.out.println("There are no data in the table...");
    }//end of method data transfer!
    //end of method data transfer!

  • Could not retrieve server initialization data

    This is in regard to recent issue reported under MS Project 2010 Proffesional edition. We were trying to connect MS Project 2010 Proffesional Client edition to MS Project 2010 server so that we can upload the project to resource center directly.
    Right information is added under info-> Accounts and post to that MS Project client reports the following error "Could not retrieve server initialization data". Please let me know how to get rid of this.
    Quick help is required!!
    Thanks
    Yash Bindlish

    - Confirm you created your Project Server account within the Project Client? This is done from the backstage by clicking File > Info tab. If you haven't completed
    this step, you cannot connect to Project Server.
    - Confirm when you open Project Professional 2010, did you register the account?
    To register the account
    FILE   >>> INFO 
    >>> "Manage Accounts"
    Also, make sure all the accounts do not have a default account. 
    This is to make sure the default "Computer" account is not being used.
    Also you can try with
     “Disable the loopback check”
    http://support.microsoft.com/default.aspx/kb/896861?p=1
    Thanks

  • Regarding Batch Jobs for migration of data from client DB to our local DB

    Hi Folks,
    GoodDay, Previously I worked as a Oracle Developer and recently shifted into a BIG organisation as PL?SQL developer. Here my base work is with INTERFACES(Stored Procedure). That is retrieving data from client DB and need to put the data in our staging tables. For that i created 2 INTERFACES(stored procedures). One is for one time migration. No need to run on regular basis. The second one is to run regularly why because if any updations are done in client DB that should be replicate to our DB. For that we need to run a BATCH JOB regulary 24X7 basis.
    But i dont have any working knowledge on BATCH JOB creation and running. Please let me guide on this issue ASAP.
    Regards,
    Ramesh.

    You can try
    dbms_job(9i)
    or
    dbms_scheduler(10g)
    just out of curiosity.. tell me if you are interested...
    what you were doing as a "oracle developer" ( is it like writing only "sql" )...

  • Getting SQL*Net more data from client waits when running a query through web based interface

    Hi, you all,
    We are having this weird behavior when running query through web based interface, we get a lot of "SQL*Net more data from client" waits, the OEM indicates that the current wait event is SQL*Net more data from client
    It's just a very simple query wich invokes a db link.
    When I execute the same query on any PL/SQL tool like toad or sql developer it works fine, but that query inside an application executed through a web based interface, it hangs for ever.
    Where can I start looking for the problem.
    We are working on a 3 Node RAC 11gr2, both databases are on the same RAC.
    Thanks.

    Hi ,
    we managed to reproduce the case in test environment, below are the steps:
    1)have 2 databases on different machines, will call the first one local, the other one remote.
    2)in the local database create:
    a - DBLink to remote database.
    b - read data from remote database(we simply used select count(*) from dummy_table )
    c - insert data into a table on the local database
    d - terminate the connection between the 2 databases (disconnect either machine from the network)
    e - commit on local database.
    what we noticed was the following:
    1)when the local database is disconnected from the network(the machine is not connected to any network at the moment): almost immediately throws an error, and issuing the following:
    select * from dba_2pc_pending;we found some data .
    2) when the remote database was disconnected(the local database is still connected to the network):
    after 7-8 seconds an error is thrown, and issuing the following:
    select * from dba_2pc_pending;did not return any data.
    since this is pretty similar to our case ,we concluded that it's a network issue.
    is this the correct behavior ?
    as a temporary solution till the network issue is fixed ,we did the following:
    1) changed the call of the remote procedure to calling a local procedure that calls the remote procedure.
    2) added pragma autonomous_transaction to the local procedure.
    3) at the end of the local procedure rollback the autonomous transaction.
    it seems that since the global transaction does not use the DBLink database does not issue a 2PC commit.
    this works in my cases since the DBLink is only issed to read data.

  • HTTP-500 Error Reading Data from Client!!

    I'm trying to create a page where by clients are able to contact us through the portal. So, it's a pretty basic form where I have a text box for the subject, and a text area for the message body.
    My problem is when the message body is over a certain size, I'm getting a "portlet cannot be contacted" on my screen. The Apache log comes up with the error:
    [error] mod_plsql: /pls/portal/!PORTAL.wwpob_page.show HTTP-500 Error Reading Data from Client!!
    I'm not using a windows OS, so the bug that has been talked about previously talked about shouldn't be the problem.
    Also, I am using a POST rather than a GET, so I don't think it has to do with the browser (and I have tested this on Firefox and IE 5.5 and IE 6).
    Would appreciate any advise.
    Thanks, Nicky

    Are you using SSL? Maybe, it has to do with it. I encountered a similar problem. It turned up that this read error occurred inside Apache and was caused by a nonstandard-SSL-request by Internet Explorer. te remedy was to add this to the Apache configuration:
    SetEnvIf     User-Agent     ".*MSIE.*"     \
    nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
    It tells Apache to switch to HTTP/1.0 and to never keep open socket connections with MSIE on SSL connections.
    Lycka till!

  • HOW to retrieve PURCHASE ORDER DATA from archieve file and print a report

    Dear all
    1) I have retrieve purchase order data from archived files.
    2)  print purchase order data and created pdf file.
    VIJ.............
    Moderator message - Please ask a specific question - post locked
    Edited by: Rob Burbank on Apr 28, 2009 12:00 PM

    Dear all
    1) I have retrieve purchase order data from archived files.
    2)  print purchase order data and created pdf file.
    VIJ.............
    Moderator message - Please ask a specific question - post locked
    Edited by: Rob Burbank on Apr 28, 2009 12:00 PM

  • The logic board on my MacBook Pro has failed. How do I retrieve all my data from the hard drive?

    The logic board on my MacBook Pro has failed. How do I retrieve all my data from the hard drive?

    Remove the drive and put it in an external enclosure. Backup the drive completely. Repartition and format the drive. Replace the drive into the computer. Take the computer in for the logicboard replacement.

  • I recently lost my MacBook pro which was synched with my apple tv.Now I'm having a problem to bring back my data from my apple tv to my new MacBook

    I recently lost my MacBook pro which was synched with my apple tv.Now I'm having a problem to bring back my data from my apple tv to my new MacBook

    Welcome to the Apple community.
    If you are referring to the first generation Apple TV, then you cannot sync content which is stored on its hard drive back to iTunes.

  • To retrieve the Maximum Date from the record

    Hi All,
    I am using the bleow query to retrieve the max date from the record list:
    select w.wr_no,w.customer_id,w.place_id, w.entry_Date, max(app.appointment_date) as appointment_date
    from work_request w , wr_appointment app
    where w.wr_no=app.wr_no
    and w.customer_id = '020167001'
    and w.place_id = '1151667'
    group by w.wr_no, w.customer_id,w.place_id, w.entry_Date;
    However i am getting the as many as three rows even after using the max function. The max date comes as the last record out the three rows retrieved.
    Thanks,
    Mark

    Mark Andrew wrote:
    And for Sven for the above customer id and place id, i receive the below result:
    WR_NO CUSTOMER_ID PLACE_ID ENTRY_DATE APPOINTMENT_DATE
    1306782233 020167001 1151667 26/07/2010 29/07/2010
    1387090103 020167001 1151667 26/02/2010 16/03/2010
    1393896673 020167001 1151667 23/01/2011 25/01/2011
    After using the rank function i will be receiving:
    WR_NO CUSTOMER_ID PLACE_ID ENTRY_DATE APPOINTMENT_DATE RK
    1393896673 020167001 1151667 23/01/2011 25/01/2011 1Now I get it.
    In fact you want to group only on the customer (and place_id?) and get all the information from the line with the last appointment date.
    Analytic functions such as RANK or ROW_NUMBER are good for this.
    The select can look like this.
    select * from (
       select w.wr_no,w.customer_id,w.place_id, w.entry_Date, app.appointment_date,
             row_number() over (partition by w.customer_id, w.place_id order by  app.appointment_date desc,  w.wr_no desc) rn
       from work_request w , wr_appointment app
      where w.wr_no=app.wr_no
      --and w.customer_id = '020167001'
      --and w.place_id = '1151667'
    where rn = 1
    ;In fact I think you can do the same operation in EXCEL directly.
    FIrst you need to sort the data by customer (asc), place (asc) and appointment date (desc).
    Then add a column in excel that give you the line where you have a new customer id.
    Assuming this new column is column H and the customerid is in column A then the function in Cell H2 would look like this.
    A function like ("=A2=A1"). Copy this formular to all the other H cells.
    Then add a auto filter on it and only select all the rows where the result is FALSE.
    Same logic as in SQL, but done in Excel.

  • SCM APO can we copy the data from client 001 to client 002???

    Hi Guru's
    SCM APO can we copy the data from client 001 to client 002???
    If it is possibulity please let me know?
    Regards,
    Sree

    Yes you can do.
    Tcode SCCL.
    Options :
    When copying clients, you can select what you want to transfer from the source client to the target client:
    User masters: You select this option, for example, if you want to give all users of an existing client the same authorizations in the target client.
    Client-specific Customizing: You select this option, for example, if you want to set up a new client in an existing system.
    Client-specific Customizing and master/transaction data:
    You select this option, for example, if you want to set up a test client that is identical to the production client (in the same system).
    Client-specific and cross-client Customizing: You select this option, for example, if you want to set up a quality assurance system based on the production client of another system.
    Client-specific and cross-client Customizing and master/transaction data: You select this option, for example, if you want to set up a test client based on the production client of another system.
    http://help.sap.com/saphelp_46c/helpdata/EN/69/c24c4e4ba111d189750000e8322d00/frameset.htm

  • Retrieving Chrome Library data from Time Machine?

    How can I Retrieve Chrome Library data from Time Machine? It seems no Library data has been backed up.  Any ideas why not and How I can get the hidden library to be backed up in the future and have access to it in Time Machine?

    We might help you better if you possibly knew what you were talking about. OS X only hides the user's /Home/Library/ folder. Only the Chrome developers know where they would be hiding a Chrome library, if there is such an animal.
    If you want to find the /Home/Library/ folder:
    Exposing the /Home/Library/ Folder
    Pick one of the following methods:
    A. This method will make the folder visible permanently. Open the Terminal application in your Utilities folder and paste the following at the command prompt:
    chflags nohidden ~/Library
    Press RETURN.
    B. Click on the Desktop, press the OPTION (⌥) button, select Library from the Finder's Go menu.
    C. Select Go To Folder from the Finder's Go menu. Paste the following in the path field:
    ~/Library
    Press the Go button.

  • HT201263 I would like retrieve all my data from my IPhone 4S after I lost all my data! Please help! ? Thank You.

    I would like retrieve all my data from my IPhone 4S after I lost all my data due constant Apple logo on! After I restored this phone I lost all my contacts, text messages, pictures, videos..!!! The question I have is if I never backed up to iCloud and iTunes is there any way I can retrieve all my data that was before restoring this iPhone 4S. Please help! ? I greatly appreciated !!!

    If you never synced your phone to your computer and your contacts were not synced to iCloud or another cloud-based service, everything is gone. You will have to start fro scratch.
    ~Lyssa

  • How to retrieve all the data from a BLOB using view-generated accessor

    I am using JDeveveloper 10g v. 10.1.3 and am storing an image in a database as a blob object and need to retrieve all of the data to get the entire image and store it in an ImageIcon. The code I have works partially in that it retrieves the correct data, but only gets a piece of it, leaving me with a partial image.
    AppModuleImpl am;
    ImageVwViewImpl vo;
    am = (AppModuleImpl)panelBinding.getDataControl().getDataProvider();
    vo = (ImageVwViewImpl)am.findViewObject("ImageVwView");
    ImageVwViewRowImpl ivo = (ImageVwViewRowImpl)vo.getCurrentRow();
    ImageIcon icon = new ImageIcon(ivo.getImage().getBytes(1, (int)ivo.getImage().getBufferSize()));
    jULabel1.setIcon(icon);I either need to know how to use a stream to get the data out (from BlobDomain method getBinaryStream()), or how to get the other chunks of data separately.
    edit: I know the problem is that getBufferSize() returns an int which is too small to hold all the data, but need to know what to use instead. Thanks!

    This is the code I'm using now. Same problem :(
    AppModuleImpl am;
            ImageVwViewImpl vo;
            am = (AppModuleImpl)panelBinding.getDataControl().getDataProvider();
            vo = (ImageVwViewImpl)am.findViewObject("ImageVwView");
            ImageVwViewRowImpl ivo = (ImageVwViewRowImpl)vo.getCurrentRow();  
            ImageIcon icon = new ImageIcon(ivo.getImage().toByteArray());
            jULabel1.setIcon(icon);

Maybe you are looking for

  • WHEN I CLICK ON SOME SONGS AN ! APPEARS TO LEFT OF SONG AND WON'T PLAY. I DON'T UNDERSTAND !

    THERE SEEMS TO BE NO RHYME OR REASON TO THIS.  THE EXCLAMATION POINT APPEARS ON SONGS THAT I HAVE PURCHASED AND DOWNLOADED AND ON SONGS THAT I DOWNLOADED FROM MY OWN CDs.  ONCE THE ! APPEARS, THE SONG WON'T PLAY.  IT'S ALWAYS THE SAME SONGS THAT THIS

  • Batch list import is picky about line terminations in the text file

    After running into trouble trying to compose a batch list for import, I isolated the issue: The text file that you attempt to import must have "carriage return" characters at the end of each line. It can have a "carriage return" and a "line feed", bu

  • Folder mgt and uploading files

    HI Regarding Folder management, i can create folders in content management server and upload them required file . is that only possible through contentmgt server ? in liferay . when i login into my app . i can goto fileupload page and create folder a

  • HT1918 What does it mean when...

    it says payment processing is temporarily unavailable. Please try again later. I'm having trouble updating application and it either gives me this notice or that my security code is wrong when its not. I need help please. How long will it take to com

  • Understanding dimensions and issues w/ Bridge

    So I'm super new to Illustrator and I'm trying to wrap my head around some basic things and I'm an idiot because I'm just not getting it. What I'm trying to do actually is create a properly sized file to upload to Zazzle, if you're familiar with the