Access Long Integer

I need to query a Long Integer from my app. I have tried using int and long but with no luck. I get a type mismatch every time it tries to execute.
This does not work
                    StringTokenizer st = new StringTokenizer(results.getSelectedValue().toString());
                    int plNum = Integer.parseInt(st.nextToken());
                    try{
                         s = con.createStatement();
                         s.execute("SELECT * FROM Packlists WHERE Packlist = '" + plNum + "'");
                    }catch(Exception e){
                         System.out.println(e);
                    }However, in a different part of my code this does:
                         s.execute("SELECT Current.Current FROM Current");
                         rs = s.getResultSet();
                         rs.next();            //eleminates invalid cursor state error
                         int number = Integer.parseInt(rs.getString(1)) + 1;
                         s = con.createStatement();
                         s.executeUpdate("UPDATE Current SET Current = '" + number + "'");any sugestions?

StringTokenizer st = new StringTokenizer (results.getSelectedValue ().toString ());
// System.out.println (st.hasMoreTokens ());
int plNum = Integer.parseInt (st.nextToken ());
// System.out.println (plNum);
try {
    s = con.createStatement ();
    String query = "SELECT * FROM Packlists WHERE Packlist = '" + plNum + "'";
    // System.out.println (query);
    // how about executeQuery here?
    s.execute (query);
} catch (Exception e) {
    System.out.println (e);
}Kind regards,
  Levi

Similar Messages

  • Accessing Long datatypes using JDBC

    Can any body help me how to access long datatypes in JDBC. I need to store large data in String object arround 100000 length string in long. as of now with pstmt.setString(1,String ) i am able to insert 32700 length string only . how can i over come this. ?
    please provide me some code for my problem .
    thanks in advance.......

    Which DB?
    Which DB field type?
    Which JDBC driver?

  • Calculate sum of long integer!

    Hi!
    Im new to java and just started to learn but have a little problem. What I want to know is how I can get a long integer from the user and then caculate the sum of the separate numbers? I thinking I would use som sort of array and then calculate from there. The thing is Im use to ada programminglanguage so I understand the problem but dont really know how to tackle the problem in java.
    So if someone could help I would be grateful!
    //Viktor

    Julingo wrote:
    "I guess you have a handle on how to get an integer from the user then? Can you write the code to get an integer from the user and display it? And "long" and "int" are two different things - which one are you talking about, a 32 bit number or a 64 bit number?"
    Yes, I do know how to get an integer from a user and display it. So far so good :) If I wasnt that clear it is a "long" 64 bit Im trying to get from user and then caculate the sum like this:
    enter integer: 1234567
    digits are 1 2 3 4 5 6 7 and the sum is 28
    /ViktorOk, so, you know how to get input from the user and display it - so - look at the API for the String class and think about your "I think I'll use an array" idea and see what you find there
    Edited by: tsith on Sep 9, 2008 7:49 PM

  • Accessing LONG datatype in Dynamic page

    I've been trying to access a LONG datatype in a cursor within a dynamic page. So far portal throws the following error:
    ORA-00922: missing or invalid option (WWV-11230)
    when I try the following code:
    <HTML>
    <HEAD>
    <TITLE>Dynamic Page</TITLE>
    </HEAD>
    <ORACLE>
    SET SERVEROUTPUT ON SIZE 100000;
    SET LONG 100000;
    declare
    v_text long;
    v_crn varchar2(10);
    cursor result_detail is
    select r.text, r.crn
    from results@mydb r
    where r.id = :p1;
    begin
    open result_detail;
    fetch result_detail into v_text, v_crn;
    htp.p etc ... display data ....
    close result_detail;
    end;
    </ORACLE>
    </BODY>
    </HTML>
    If I leave out the SET commands it can't find the page.
    Any clues? Has someone worked out how to get a LONG datatype value into Portal?
    Version 902.6.18 (win 2000 server)
    Thanks for any help.
    Philippe

    The SWF file was developed to work in such a way as it would only look in the root directory for the XML file.  Once the developer changed it so that it could access it from the same directory (regardless of what directory it was in), and then had to add 'id' and 'src' to the JavaScript function call, it worked like a charm.
    ^_^

  • Cleaning user mailboxes that hasnot be accessed long time

    Good time of a day for all!
    I have 2 questions:
    1) How can i find all users, that did not access their mailboxes since some date (for ex. after 1st of September in this year) by standart tools of IMS?
    (it's needful to say that mail store was scanned by different ways, so access time of all mailboxes is current, i think)
    2) How can i clear their mailboxes? Or even so: can i find and clear that folders by some tools of IMS?
    (Can i simply do cd ../=user/XX/YY/=username/INBOX;rm -r * ?)
    Thank you for for any reply!

    For example, active imap user, that is often checks his mail and is currently using his account, store his messages on server. And if i,administrator, tune aging policy to delete ALL messages that older then 90 day, this will delete also those messages, that are just being stored on server by active users.
    But i want to delete only all messages for inactive accounts, for users, that are already long time not using their accounts and are not checking their mail since 1st September.
    Thats a problem - how to find all users that are inactie since 1st of September, for ex.
    but i begin to think, its impossible :(
    may be, access time of files store.idx or store.usr shows the last time user login to check mail ???

  • Accessing LONG RAW data information

    Hi,
    Can anybody help me in knowing the information stored into a LONG RAW column. I would appreciate it in either SQL / PL SQL.
    Thanks in advance.
    Anil.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Anil Budhkar ([email protected]):
    Hi,
    Can anybody help me in knowing the information stored into a LONG RAW column. I would appreciate it in either SQL / PL SQL.
    Thanks in advance.
    Anil.<HR></BLOCKQUOTE>
    well you have DBMS_LOB functions. Tou can visit the website for documentation and try using them. But what type of data is it.
    null

  • How to convert double to unsigned long integer for cRIO analog output?

    All,
    Having issues sending out my arbitrary waveform to my cRIO analog output. My values are doubles and by the time I send them out, they have been converted to U32 values and are all turning out as zeroes. This led me to assume two things: 1) That cRIO analog output can only output integers since the values need to be deployed in the memory first and 2) that I'm missing a step in the conversion process. My values range from 0-8, therefore I don't expect that the simple conversion tool in labview should make everything into zeroes.
    Any help?

    Since we are using the cRIO's FPGA interface, you really should be doing most of this inside of the FPGA.  Use DMA FIFOs to pass your data between your RT and the FPGA (and visa versa).
    On your FPGA, you can have a loop that just reads the analog inputs at whatever loop rate you want.  You just send the data to the RT using a DMA.
    Similarly, use a DMA to send your analog output values to the FPGA.  The FPGA can have another loop that reads the DMA and writes the value to the analog output.  This should be done in the FPGA since you can have the FPGA send out the values at a given (and deterministic) loop rate.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to tanslate long integer to date format ?

    import java.util.Date;
    import java.text.*;
    import java.io.*;
    public class ex_date02 {
    public static void main(String[] args) {
    File fTimeOut = new File("template.java");
    DateFormat defaultDate = DateFormat.getDateInstance();
    System.out.println(defaultDate.format(new Date()));
    DateFormat myformat = new SimpleDateFormat("yyyy/MM/dd HH:MM");
    System.out.println(myformat.format(new Date()));
    System.out.println(fTimeOut.lastModified());
    }

    Thank a lot
    import java.util.Date;
    import java.text.*;
    import java.io.*;
    public class ex_date02 {
    public static void main(String[] args) {
    File fTimeOut = new File("template.java");
    DateFormat defaultDate = DateFormat.getDateInstance();
    System.out.println(defaultDate.format(new Date()));
    DateFormat myformat = new SimpleDateFormat("yyyy/MM/dd HH:MM");
    System.out.println(myformat.format(new Date()));
    System.out.println(fTimeOut.lastModified());
    System.out.println(myformat.format (new Date (fTimeOut.lastModified())));
    Output is
    04-Feb-03
    2003/02/04 01:02
    1044337905000
    2003/02/03 21:02

  • Error while updating a record in MS Access

    Im new to coldfusion and am running into a problem while
    trying to update a record in a MS Access table.
    I have a MS Access table where the primary key is a
    auto-number long integer field named jobid.
    I have an edit form where info can be changed then saved. A
    hidden form field named jobid holds the records primary key field
    value for the record being edited. When submitted this is what
    happens:
    I use a basic SQL UPDATE statement but I get the error "Data
    type mismatch in criteria expression"
    Some code:
    <cfset nJobId=Int(Val(FORM.jobid))>
    *dont know if i need the above line but using #FORM.jobid#
    in the WHERE clause below didnt work either
    <cfquery datasource="lrs">
    UPDATE jobs SET
    status='#FORM.status#',
    offer='#FORM.offer#',
    postdate="#CreateODBCDate(FORM.postdate)#",
    jobtype=#FORM.jobtype#,
    jobtitle='#FORM.jobtitle#',
    ..etc...
    WHERE jobid=#nJobId#
    The WHERE clause is where the error occurs with "Data type
    mismatch in criteria expression"
    After a few times with that i changed the where clause to
    simply "WHERE jobid=1" as this record id does exist, but it has the
    same error.
    I then tried changing the where clause to
    WHERE jobid=<cfqueryparam cfsqltype="cf_sql_bigint"
    value="#FORM.jobid#">
    and there it "appears" to work, but the record is not
    actually updated. No changes are made to the table though no error
    is thrown.
    Im missing something here... why wont the record update
    ?

    The data type mismatch isn't necessarily in your where
    clause. I'm guessing that it's the quotes around the create
    odbcdate function.
    use of cfqueryparam will solve a lot of these problems for
    you.

  • Access 2013: Sum fields on a form suddenly showing up blank

    I have a simple Access database (originally built in 2010, now running 2013). Sometime in the last week or so all of the SUM fields in the database started showing up BLANK (one minute everything was working fine, the next it wasn't, not sure what happened
    in between). Even when I create a new, basic form, I can't seem to get my SUM fields working.
    For example, I have a table where I document number of miles traveled for work purposes, the fields include: TravelDate, ProjectID, Mileage, and Description. Mileage is a Number field, Long Integer. If I create a continuous form, connect it to the table
    (same thing happens if I connect to a query), add a field in the Detail section with
    Mileage as control source and txtMileage as name and a field in the FORM FOOTER that is: =Sum([txtMileage])...the SUM field is empty in
    Form View. And, there are no NULL values in the data set. This is happening across all of my forms and subforms, all SUM fields are now displaying as blank.
    Is it possible that I changed a global Access setting to cause this? A form setting? Any other ideas?
    Thanks!
    Laura

    I had the same sudden issue. But I was able to determine that it involved only one workstation. All the others were fine, as well as a test run on another Win 8 station outside the environment. From there I was able to determine that  a third party
    app had been installed near the time of the problem showing up. I uninstalled it and it immediately was resolved. The app was a C# based tool thought the authors have yet to identify why this caused a problem. My suspicion is that they wrote a 32 bit version
    and this was installed on a 64 bit station, and there is some issue with mso.dll, where I believe the function calls exist for sum. I am testing to see if there are similar function errors in Excel.
    What is noticeable was that Access did not throw a an Error# nor a #name. Just nothing appeared, and when you click on a row, the sum would appear, though it was incorrect.
    In Access 2010 I remember there were some footer field issues in continuous which eventually were patched.
    It was an opportunity to remind my client - do not install anything from any one on the live system without prior testing.

  • How to reduce size of a huge table in Access

    We have an Access mdb file that is getting too large.  It is about 1.7 GB, and will probably hit 2.0 GB in two or three months.  It has already been compacted.  There are only two tables, and 99% is from just one of the two tables, which has
    about 8.4 million records.  What are some strategies I could use to reduce the file size?  I've already done the database splitting strategy.  This is one of three back-end files in the split set.  I think some users might have Access 2003,
    so if you have a solution that is unique to Access 2007/2010, I'm not sure if it will be viable or not.

    Here it is.  Your question prompted me to change the datatype on Account and Fiscal Year, which were previously Text.  That reduced the size by 0.1 GB, but I definitely need to make further improvement.
    Company Code
    Text
    Cost Center
    Text
    Account
    Long Integer
    Item Number
    Text
    Item Description
    Text
    Charge Code
    Text
    Qty
    Double
    Unit of Measure
    Text
    Cost Per Unit of Measure
    Double
    Total Expense
    Double
    PO Number
    Text
    Vendor Name
    Text
    Vendor Number
    Text
    Source Type
    Text
    Fiscal Year
    Integer
    Fiscal Period
    Long Integer
    Journal Type
    Text
    Transaction Date
    Date/Time

  • Update a field in an access database via TestStand

    I want to read a value from a numeric field in an MS Access database, increment that value by one, and then update the database record that I got the value from with the new value. I am able to execute an Open Database step, execute a Open SQL Statement step with a SELECT query, execute a "Get" operation in a Data Operation step to get the value into a TestStand variable, and increment the value, but I'm at a loss for how to update the databse record with the incremented value.
    I tried to execute another Open SQL Statement step with an UPDATE statement, but I get a "Specified value does not have the expected type." error. The TestStand variable type is a number, and the Data Type of the database field is Number. I've tried using long integer, double, and decimal as field sizes, but they all give me the same error.
    I also tried to execute a "Set" operation with another Data Operation step against the original Statement Handle. When I do this, the Data Operation runs without error, but when I run a Close SQL Statement step against the statement handle I get an "ADODB.Recordset: Operation is not allowed in this context." error.
    Any help would be appreciated.

    Scripter -
    When you try to do a Set and Put, it is always good to explicitly set the statement's cursor type to something other than forward only, like keyset, and the lock type to something other than read-only. See if that helps...
    Scott Richardson
    National Instruments

  • Problems inputing data through JOptionpane to a Access Database

    I am kinda stuck at how to input a new order through JOptionpane's that adds new information into a MS Access Database. I have been fine with coding to get an order through a search JOptionpane as shown below:
    if (e.getSource() == btnCheckOrder)
    String strInput=JOptionPane.showInputDialog("Enter an order number");
    LinkedList Orders = Xenon.findOrders((long)Integer.parseInt(strInput));
    if(Orders==null)
    txtDisplay.setText("No Results Found! Please Try Again!");
    else
    txtDisplay.setText(Orders.toString());
    Any help or advice on how to solve this problem would be great, as im at my wits end.

    So far i have came up with this in my GUI class:
    if (e.getSource()== btnAddOrder)
    String Orders = JOptionPane.showInputDialog(this,"Order Number", "New Order Number",JOptionPane.INFORMATION_MESSAGE);
    if (Orders == null)
    return;
    String strInput = JOptionPane.showInputDialog("Customer Number", "Enter Customer Number");
    long CustNum = 0;
    strInput = JOptionPane.showInputDialog("Part Number", "Enter Part Number");
    long part_Num = 0;
         strInput = JOptionPane.showInputDialog("Number Ordered", "Enter Number Ordered");
    long Num_Ordered = 0;
         strInput = JOptionPane.showInputDialog("Quoted Price", "Enter Quoted Price");
    double Quoted_Price = 0;
         strInput = JOptionPane.showInputDialog("Order Date", "New Order Date");
    long OrderDate = 0;
         strInput = JOptionPane.showInputDialog("Rep Number", "Enter Rep Number");
    long repNum = 0;
    confirmDialog = new JDialog((Frame) null,"Dialog",true);
    Container dialogContentPane = confirmDialog.getContentPane();
    dialogContentPane.setLayout(new FlowLayout());
    JButton okButton = new JButton("OK");
    okButton.addActionListener(new ActionListener(){
    public void actionPerformed(ActionEvent e ){confirmDialog.dispose();}
    dialogContentPane.add(new JLabel("Confirm New Order"));
    dialogContentPane.add(okButton);
    confirmDialog.setBounds(150,150,150,120);
    confirmDialog.show();
    This seems to work but doesnt add the data i input into the database.

  • 32 bit integer size on 64 bit processor and OS

    Although not strictly a dbx question, I think the audience here is the correct one to bounce this off of:
    I'm curious: Why are 64 bit processes compiled with the -xarch=v9 switch having a 32 bit integer size, versus having 64 bit integer size?
    Although not cast in stone, and implementation dependent, an "int was originally intended to be the "natural" word size of the processor - to use the processor's "natural" word size to improve efficiency (avoid masking, etc).".
    I know you 'force' more 64 bit use (see some of Sun's doc on this below).
    ===============
    The 64-bit Solaris operating environment is a complete 32-bit and 64-bit application and development environment supported by a 64-bit operating system. The 64-bit Solaris operating environment overcomes the limitations of the 32-bit system by supporting a 64-bit virtual address space as well as removing other existing 32-bit system limitations.
    For C, C++, and Fortran software developers, this means the following when compiling with -xarch=v9,v9a, or v9b in a Solaris 7 or Solaris 8 environment:
    Full 64-bit integer arithmetic for 64-bit applications. Though 64-bit arithmetic has been available in all Solaris 2 releases, the 64-bit implementation now uses full 64-bit machine registers for integer operations and parameter passing.
    A 64-bit virtual address space allows programs to access very large blocks of memory.
    For C and C++, the data model is "LP64" for 64-bit applications: long and pointer data types are 64-bits and the programmer needs to be aware that this change may be the cause of many 32-bit to 64-bit conversion issues. The details are in the Solaris 64-bit Developer's Guide, available on AnswerBook2. Also, the lint -errchk=longptr64 option can be used to check a C program's portability to an LP64 environment. Lint will check for assignments of pointer expressions and long integer expressions to plain (32-bit) integers, even for explicit casts.
    The Fortran programmer needs to be aware that POINTER variables in a 64-bit environment are INTEGER*8. Also, certain library routines and intrinsics will require INTEGER*8 arguments and/or return INTEGER*8 values when programs are compiled with -xarch=v9,v9a, or v9b that would otherwise require INTEGER*4.
    Be aware however that even though a program is compiled to run in a 64-bit environment, default data sizes for INTEGER, REAL, COMPLEX, and DOUBLE PRECISION do not change. That is, even though a program is compiled with -xarch=v9, default INTEGER and REAL are still INTEGER*4 and REAL*4, and so on. To use the full features of the 64-bit environment, some explicit typing of variables as INTEGER*8 and REAL*8 may be required. (See also the -xtypemap option.) Also, some 64-bit specific library routines (such as qsort(3F) and malloc64(3F)) may have to be used. For details, see the FORTRAN 77 or Fortran 95 READMEs (also viewable with the f77 or f95 compiler option: -xhelp=readme).
    A: No program is available that specifically invokes 64-bit capabilities. In order to take advantage of the 64-bit capabilities of your system running the 64-bit version of the operating environment, you need to rebuild your applications using the -xarch=v9 option of the compiler or assembler.

    I think that this was basically to keep down the headaches in porting code (and having code that will compile to both 32bit and 64bit object files). int is probably the most common type, so by keeping it at 32bits, the LP64 model has less effect on code that was originally written for 32bit platforms.
    If you want to have portable code (in terms of the sizes of integral types), then you should consider using int32_t, int64_t etc from inttypes.h. Note that this header is post-ANSI C 90, so might not be portable to old C/C++ compilers.
    A+
    Paul

  • Problems with Memo data type in access

    I have a Java program which is connected to a Microsoft Access Database. When trying to get a Memo data type field out of the DB and putting it into a StringBuffer, it causes a Function sequence error, even though it does put the field into the said StringBuffer.
    For all other data types, like text (string), long integer etc there is no error but only for a memo field.
    What's the best way to get a memo field out of an Access DB without it causing problems? or should i just forget Microsoft's Access and make my DB in Oracle?

    Hi! Can you tell me how connect a java program with a Microsoft access DB? Should I have to use a particular driver? Where I can find it?
    thank you vcery much for your help!!

Maybe you are looking for

  • TDS in A/P Credit memo

    Hi Guru's,                  Can anybody tell me that how to reverse the A/P invoice having with holding tax? I mean to ask that, I am trying to pass the reverse A/P invoice by using A/P Credit Memo but I found that its giving the withholding column u

  • 2.1.0.62: Problem with Package.Functions and Unit Tests

    I like the new Sqldeveloper - I startet trying Unit Tests as described here: Link: [http://www.oracle.com/technology/obe/11gr2_db_prod/appdev/sqldev/sqldev_unit_test/sqldev_unit_test.htm#t4] It worked with a test-procedure. Now i am trying to test my

  • Recovery after hard drive replacement - pavillion dv6 notebook

    Hi, I am just about to replace a faulty hard drive on my pc but I am unsure how to proceed with the windows recovery process. I was wondering if I need to contact HP for a recovery set despite the fact I have a recovery (D: ) drive on my laptop. I am

  • Cost of Adobe LiveCycle Designer ES

    Hi Friends, 1. I would like to know the cost of Adobe LiveCycle Designer ES 2. Yearly Maintenance cost for the same. Thanks.

  • EPS File and FCP/Motion

    Ladies/Gentlemen, I have my Logo in a EPS Format and I am trying to keep the Transperancy. I tried exporting out of Photoshop and Illustrater as a Tiff file with no success. I also tried Jpeg , but ofcourse I get a white background. Can anyone let me