To retrive console data of MSAccess .How to dispaly  result on a Component

hai there
Im new to Java programming.I dont know how to get the result of following query "select SUM(Total) from Records where Date=adate AND MedicalName=somename"
This query results Expr1000
30,4589.7
Expr1000 is not a cloumn name.How can i retrive the figure above and to dispaly in a JTextField.
if i execute the code below to retrive required,it generates SQL Exception.
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:ashok", " ", " ");
pstat=con.prepareStatement("select SUM(Total) from Record where Date=? AND MedicalName=?");
pstat.setString(1,(String)jList11.getSelectedValue());
pstat.setString(1,(String)jComboBox1.getSelectedItem());
r1=pstat.executeQuery();
jTextField1.setText(r1.getString("Total"));
catch(Exception e)
System.out.println("GRAND T :"+e);
if i execute the above code it generates SQL Exception:COUNT Field Incorrect.
Plz help to solve this problem.

hi zhaoyh
This is ashok.Thanks a lot for ur reply.I corrected my mistake.
I have a problem on setting the result in a JTextField for the following query.
"select SUM(Total) from Record where Date=? AND MedicalName=?"
if execute this query in MSAccess or in Oracle as
SELECT SUM(Total) FROM Record WHERE Date=06/10/2005 AND MedicalName='Sakthi'
Cosole shows Expr1000
34000.5
Expr1000 is not a column in my table.But i need to set 34000.5 in my JTextField.
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:ashok", " ", " ");
pstat=con.prepareStatement("select SUM(Total) from Record where Date=? AND MedicalName=?");
pstat.setString(1,(String)jList11.getSelectedValue());
pstat.setString(2,(String)jComboBox1.getSelectedItem());
r1=pstat.executeQuery();
jTextField1.setText(// HERE I NEED THE RESULT WHICH IS DISPLAYED ABOVE IN CONSOLE OF MS ACCESS OR IN ORACLE
catch(Exception e)
System.out.println("GRAND T :"+e);
Pls help to solve this problem .

Similar Messages

  • How to retrive relational data from an XMLType column in Oracle 10g R2

    Hi
    I want how to retrive the data which is in XML document in an XMLColumn in a Table(or an XMLTable which has the XML Document). This XML Document has to be Queried with XQuery as a Relational data(not an XML Document).
    If any body has some ideas please share it across ASAP.
    please share an example for this because i am new to this XQuery.
    Thanks in Expectation,
    Selva.

    Got it working now. I used the 'extract' function in my select statement, but had to add the .getStringValue() fuction. The extract function, just by itself, returns an XMLDocument type. The call for the column in the SQL statement looked like this.
    extract(XML_CONTENT, '/ROOTOBJECT').getStringVal() xml_content
    Thanks so much for your help. Problem solved!

  • How to retrive the data from a sqlite file(.db3) in windows phone 8.1(runtime)

    hey guys
    i installed the sqlite and sqlite-net as requested in other answers i found, changed to x86, and add the .db3 file in my project.
    but the problem is how to retrive the data that already in the file( i am not creating any table or data in the app, just read)
    all the answer i found is to create a table first and then read the table, i tried to skip the step of creating a table, and read from the table directly, but failed with " no such table", by the way, i set the property of the .db3 file as "content",
    "copy if newer"
    can anyone please help? i appreciate that !

    Hello,
    From your description, you want to read data from available sqlite file. When you add the sqlite file into your project, you need to change the sqlite file build action to content. After deploying to device, the sqlite file is located in installation folder,
    you need to copy that file into storage folder before reading data. Please try the following code snippets.
    private async void Button_Click_9(object sender, RoutedEventArgs e)
    //check if file exists in storage folder, and then copy to local storage
    bool flag = await FileExistsAsync("Data.db3");
    if (!flag)
    var folder = await Package.Current.InstalledLocation.GetFileAsync("Data.db3");
    await folder.CopyAsync(Windows.Storage.ApplicationData.Current.LocalFolder);
    // open sqlite and read data
    public async Task<bool> FileExistsAsync(string fileName)
    try
    await Windows.Storage.ApplicationData.Current.LocalFolder.GetFileAsync(fileName);
    return true;
    catch (FileNotFoundException)
    return false;
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate
    the survey.

  • Root disk craches how to retrive the data from ZFS file systems.

    Hi Friends,
    The solaris 10 OS (root disk) is crached.i have configered execpt root disk to all disks for ZFS file systems.We using to application.Now any possble to retrive the data.
    Server model - V880
    Pls help me.
    Advance thanks.

    If the OS wasn't on ZFS, then just rebuild the server, hook up the drives and run 'zpool import'. It should find the pool on the disks and offer it up to be imported.
    Darren

  • Brief about Console, data manager and Import manager

    Hi,
    Iam new to MDM we just started installing our MDM components and iam a MM functional guy Can you any one tell me about console, data manager and import manger i need to know the following,
    1. what is it
    2. How the 3 is interlinked
    3. can the data manager be loaded directly without a import
    4. is there a std way of creating repository
    5. I need to do samples on vendor, customer harmonisation and the spend analysis and matl master harmonisation..
    Iam asking too much in this forum but i knw you guys are there to help me out.
    Thanks in advance,
    Suresh

    MDM Console
    The MDM Console allows the system manager to administer and monitor the MDM Server, and to create, maintain the structure of, and control access to the MDM repositories themselves. Records are not entered or managed with the MDM Console, but rather with client apps such as the MDM Client.
    MDM Client(data manager)
    The MDM Client is the primary client of the MDM Server, and is the program most users see on their PCs. It allows users to store, manage and update master data consisting of text, images, and other rich content, and to create taxonomies, families, and relationships. Other clients include the Import Manager, the Image Manager, and the Syndicator.
    Import Manager
    Allows you to import master data from most types of flat or relational electronic
    source files (e.g. Excel, delimited text, SQL, XML, and any ODBC-compliant source),
    and to restructure, cleanse, and normalize master data as part of the import process.
    <i>2. How the 3 is interlinked</i>
    --->
    Suppose you are sending vendor information to MDM repository be sending IDOC from R/3. Then the whole process can go as... IDOC will be sent to XI, so XI will generate XML file that contains data. Then import manager can import this file and will so place the data in repository.
    Now if you want to send data in MDM repository, the process goes reverse way. Syndicator will generate flat/xml file. This file will be given to XI so that XI will generate IDOC out of it and will send it to XI. This whole process ensures data consistancy
    For details refer this link
    http://help.sap.com/saphelp_mdm550/helpdata/en/43/D7AED5058201B4E10000000A11466F/frameset.htm

  • How to compare result from sql query with data writen in html input tag?

    how to compare result
    from sql query with data
    writen in html input tag?
    I need to compare
    user and password in html form
    with all user and password in database
    how to do this?
    or put the resulr from sql query
    in array
    please help me?

    Hi dejani
    first get the user name and password enter by the user
    using
    String sUsername=request.getParameter("name of the textfield");
    String sPassword=request.getParameter("name of the textfield");
    after executeQuery() statement
    int exist=0;
    while(rs.next())
    String sUserId= rs.getString("username");
    String sPass_wd= rs.getString("password");
    if(sUserId.equals(sUsername) && sPass_wd.equals(sPassword))
    exist=1;
    if(exist==1)
    out.println("user exist");
    else
    out.println("not exist");

  • I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    I have a large number of photos imported into iPhoto with the dates wrong.  How can I adjust multiple photos (with varying dates) to the same, correct, date?

    If I understand you correctly, when you enter a date in the Adjust Date and Time window, the picture does not update with the date you enter.  If that is the case then something is wrong with iPhoto or your perhaps your library.
    How large a date change are you putting in?  iPhoto currently has an issue with date changes beyond about 60 years at a time.  If the difference between the current date on the image and the date you are entering is beyond that range that may explain why this is not working.
    If that is not the case:
    Remove the following to the trash and restart the computer and try again:
    Home > Library > Caches > com.apple.iphoto
    Home > Library > Preferences > com.apple.iPhoto (There may be more than one. Remove them all.)
    ---NOTE: to get to the "home > library" hold down option on the keyboard and click on "Go" > "Library" while in the Finder.
    Let me know the results.

  • Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Once 10.9.1 is loaded onto my MacBook Pro and it has accessed all my files; is there anyway to back out of the relationship?  I don't want my data on iCloud - how do I make that happen?  Many thanks for any help.

    Sorry but I know of no way of not backing up for a PC.

  • HT1339 I have to restore my ipod, will it delete all of my data, if so how can I back it up???

    I have to restore my ipod, will it delete all of my data, if so how can I back it up??? My ipod won't let me delete any photos, or download any apps, so I turned it off and back on when the itunes and usb symboyl appeared I just download Itunes, and i can only restore it, Will it delete everything?!?!

    Yes, you need to restore. Here is how:
    Plug your iPod into a computer with iTunes
    Go into your iPod's section on the bar on the left hand side of iTunes
    Click restore
    Confirm the restore with the dialog boxes that pop up.
    When it is done, if you have a recent backup of your iPod in iTunes, you can tell it to use it.

  • I have updated my 4s iphone to ios 6.1.3 and have trouble connecting it to wi fi . i tried to back up it on itunes and then restore it but now i have left with a phone that still doesnt connect to wi fi and  lost all my data. anyone knows how to fix it?

    i have updated my 4s iphone to ios 6.1.3 and have trouble connecting it to wi fi . i tried to back up it on itunes and then restore it but now i have left with a phone that still doesnt connect to wi fi and  lost all my data. anyone knows how to fix it?

    If no change after restoring the iPhone with iTunes as a new iPhone or not from the backup, there is a hardware problem.

  • Your Firefox profile cannot be loaded. It may be missing or inaccessible old friefox data on desktop how do i fix it

    I get a message that said Your Firefox profile cannot be loaded. It may be missing or inaccessible and I now have a folder the said old friefox data on desktop how do i fix it

    See:
    *https://support.mozilla.org/kb/how-run-firefox-when-your-profile-missing-or-inacc
    This is usually caused by a problem with the profiles.ini file and the profile marked as Default=1 in this file is no longer present on the hard drive.
    *Windows: %AppData%\Mozilla\Firefox\<br>C:\Users\&lt;user&gt;\AppData\Roaming\Mozilla\Firefox\Profiles\&lt;profile&gt;\
    *Linux: ~/.mozilla/firefox/
    *Mac: ~/Library/Application Support/Firefox/
    You can use one of these to make Firefox create/use a new default profile:
    *Delete the profiles.ini file to force Firefox to create a new default profile
    *Use the Profile Manager to create a new profile
    *Use "Choose Folder" when you create a new profile to select the location of a lost profile and recover this profile
    *http://kb.mozillazine.org/Profile_Manager
    *https://support.mozilla.org/kb/Managing+profiles
    *http://kb.mozillazine.org/Profile_folder_-_Firefox

  • How to dispaly System date time on Jsff page ?

    Friends,
    It would be simple question for you , Any one has idea about
    How to dispaly System date time on Jsff page using any expression laungage ?
    Thanks in Advance

    Hi,
    I have a solution for you I hope that is helps.
    add this to the top of your page...
    <jsp:useBean id="now" class="java.util.Date" scope="request" />
    so, you want the current date?
    <af:outputText value="#{now}"/>
    you can use the format for date also.
    I hope it is what you want.

  • Since upgrading my iPhone 5 to ios 7, I cannot get the internet, email to work on 3g.  I get the message ""could not activate mobile data network. You are not subscribed to a mobile data service".  How do I fix it?

    Since upgrading my iPhone 5 to ios 7, I cannot get the internet, email to work on 3g.  I get the message ""could not activate mobile data network. You are not subscribed to a mobile data service".  How do I fix it?
    I've contacted o2, tried all of their suggested updates and changes, reset my phone 3 times and still no luck.
    Any help appreciated.
    Thanks,
    Louisa

    Hi, l have the same problem, were you able to resolve?

  • Retriving of data from different tables

    retriving of data from different tables depening of the primary key  this key field is there in all tables   if it is there in one v table it should continue to other tables otherwise it should get exit from that it should display information message or otherwise success  message if it is there in all tables .

    Im writing the concept, just check it.
    SELECT * from kna1 into lt_kna1.
    if sy-subrc eq 0.
       selest * from lfa1 into lt_lfa1
    for all entries in lt_kna1.
    endif.

  • I have two iphones , i lost one  and entered to find my iphone and as mistake i block both and delate all the data of both. how can i get it on, im trying to restore it , but its not working ...

    i have two iphones , i lost one  and entered to find my iphone and as mistake i block both and delate all the data of both. how can i get it on, im trying to restore it , but its not working ...

    Hi Roger
    Thank you for your reply.
    My original feed is: http://casa-egypt.com/feed/
    However, because I modified the feed http://feeds.feedburner.com/imananddinasbroadcast and nothing changed, I redirected it to another feed and then I deleted this feed.
    Is there any way to change the feed in itunes? The only feed I have now is  http://feeds.feedburner.com/CasaEgyptStation
    I tried to restore the feed http://feeds.feedburner.com/imananddinasbroadcast but feedburner refused.
    I know that I missed things up but I still have hope in working things out.
    Thanks is advance.
    Dina
    Message was edited by: dinadik

Maybe you are looking for

  • IOS 7.0.2 - ITunes Manually manage music and videos option - all of my music has disappeared?

    Hi all - I clicked the above option because I was having issues moving tracks to my I-Phone.  Except now, ALL of the songs I have ripped manually from my old CDs previously have disappeared - ***?  I'm talking well over 800 songs!!!!!! I can't see th

  • WiFi - How to connect to Orange Livebox - Tecra A5

    I cannot connect my Tecra A5 laptop to my Orange Livebox can you please help DO NOT if in this situation contact Orange they are inept and totally useless their telephone advisers do not even know the phonetic code when explaining typing codes/instru

  • Performance: Bulk Insert Oracle 10g

    Following Situation: We have a VISUAL BASIC 6 Application (I know ... VB6 ... ), an XML-File with data and an Oracle 10g database. The XML-File has to be imported in the database. Up to now the Application (Via ADO) analyses the XML-File and creates

  • Newbe Question: Setting a cursor image from a source file

    I have a panel that is dynamiclly loaded with images from files. I wanted to set the cursor to the image, originally I was going to load a sprite with the image and have it follow the cursor but I figured that it might be better using the CursorManag

  • User exit EXIT_/SAPAPO/SAPLCIF_PU_001

    Hi, We are using this exit to block Purchase orders from a particular storage location. We gave the condition with a IF clause to ckeck for the ATP category and storage location, but the orders are not getting blocked. SAP replied to this query that