Updating array data in sql database

HI,
Im facing problems in updating array data in SQL database.
As of now, i am able to write an "insert" query and insert array data in an image datatype field. Im using image datatype because the array size is very big(around 80,000 x and y values).
Althoug inserting data is easy im unable to write a query to update this data.
Referring to the help of SQL server and Labview database connectivity toolkit, i came across a method of accessing image datatype....using textpointers, which are 16 bit binary values and using the WRITETEXT function instead of the UPDATE function.
but the problem im facing is that ive to pass the array as a 2d string array in the query as a result the updated array is retrieved in the form of a string a
nd not as an array. how do I get over this problem?

Hi Pavitra,
I'm not very clear on how you have inserted the data into your application, but I do know that when you call the UPDATETEXT or WRITETEXT function you use the TEXTPOINTERS to point to the first location of a 1d array. So, depending on how you've stored the data, you may have problems updating your data if you're looking at it as a 1d array instead of how you originally formatted it. If you are able to successfully access the data as a 1d array, you can use the database variant to data type vi and pass in a string array constant for the data type. This will convert the variant datatype into whatever you specify. You may have to index the row and column of the variant (you receive a 2d array of variant) first before you convert. If possible, can yo
u provide some more detail and maybe some example code of how you perform the insert and plan to do the update? I can probably give you a better solution if I know how you are formatting the data. Thanks!
Jeremy L.
National Instruments
Jeremy L.
National Instruments

Similar Messages

  • Submit pdf form data to sql database

    Where I can find detailed information on the process of sending data from pdf form stored on the website to the sql database stored on web server ?? Where I can find some samples I could use to build my form and related script(s).
    Thanks for advice.
    Tony

    Hi Paul,
    Thank you very much for your quick response. I can not retrieve your
    attachments, so please send them by email. Thank you.
    What does it mean that DSN has to be set up on each machine which will run
    the form ??? Does it mean for each person who will use the form ?? or
    rather once on the server where the form is hosted ??? It will be a bit
    difficult to use if it will have to be installed on each user computers as
    some users may not be happy to do it. If this is the case do you have any
    solution you would recommend which will collect the data from the form
    without asking users to do anything special on their computers ????
    Regards,
    Tony Pluta
    Graphics Designer
    Broadmeadow Road
    Broadmeadow NSW 2292
    Australia
    Direct: +61 2 9492 1277
    Facsimile: +61 2 9462 1383
    Mobile: +61 403 399 167
    [email protected]
    www.unitedgroupltd.com
    pguerett <[email protected]>
    22/04/2009 10:31 PM
    Please respond to
    [email protected]
    To
    Tony Pluta <[email protected]>
    cc
    Subject
    submit pdf form data to sql database
    If you want the form to contact the DB directly you will have to set up a
    DSN on each of the machines that will run the form. Note that this wil
    only work on Windows machines. Also the form must be launched for the
    script to run (you mentioned the PDF was stored on the web server). I have
    some samples that show how to deal with a DB but the attachments do not
    seem to be working correctly on the forum yet. If you cannot retrieve them
    post your email and I will email them to you directly.
    Paul

  • "Failed to update binary data in the database".

    Hi,
    we will get this message ("Failed to update binary data in the database".) when one of our customers want to install our add-on in one specific server.
    they got a copy of their database and put in another computer and could install add-on. but they can not install add-on on their main server.
    please advice me.

    Hi Senthil,
    Thanks for your consideration,
    They checked and they don’t have any record in SARI table related to R1. they have one record for XLR only.
    This problem is only on one specific server.
    Do you have any other idea? Please help us.
    Regards,
    Neda

  • Error when save date in SQL database

    Hi all,
    I try to save a date in to a sql database, but when I run my program I get following error:
    Invalid object 11/21/05 9:32 AM of type java.sql.Date assigned to host variable 3.
    In my database table I have a fields date (type Data)en time type(Time).
    this is the source:
         public void createTitle(int title_id, String description, String user)
              throws SQLException {
              // TODO Auto-generated method stub
              Date date = new Date();
              String dateFormat = "YYYY-MM-DD";
              String timeFormat = "HH:mm:ss";
              SimpleDateFormat ddf = new SimpleDateFormat(dateFormat);
              SimpleDateFormat tdf = new SimpleDateFormat(timeFormat);
              String det = ddf.format(date);
              String creationTime = tdf.format(date);
              PreparedStatement newTitle = conn.prepareStatement("INSERT INTO BE_TITLE (TITLE_ID, DESCRIPTION, DATE_CREATE, TIME_CREATE, USER_CREATE) VALUES (?,?,?,?,?)");     
              try{
                   newTitle.setInt(1,title_id);
                   newTitle.setString(2,description);
                   newTitle.setDate(3, new java.sql.Date(date.getTime()));
                   newTitle.setTime(4, new java.sql.Time(date.getTime()));
                   newTitle.setString(5, user);
                   newTitle.executeUpdate();
              }finally{
                   newTitle.close();
    Can someone give me a solution for this error
    Richard

    Hi Richard,
    in your application, you atempt to insert a java.sql.Date value into a DATE column, which has non-zero time-components. Open SQL rejects such an atempt.
    Please allow me to quote from the OSS message (452727 2004), which Detlev refers to in his quote:
    <i>
    about one year ago, we had a very lengthy discussion on this issue - not only internally at SAP but also with Jonathan Bruce, the specification lead for JBDC at Sun.                                                                               
    We have the following dillema:                                                                               
    The javadoc of the constructor java.sql.Date(long) states:                                                                               
    "If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT."                                                                               
    With Jonathan Bruce, we tried to clarify when this normalization should take place.                                                               
    1) Source code inspection shows that it is not the class java.sql.Date the performs the normalization.                                                                               
    2) The Javadoc states that the JDBC driver should perform the             
    normalization. If it is the driver, more open questions arrise:                                                                               
    a) When shall the normalization be performed?                             
       - if a setDate method is invoked?                                      
       - only for INSERT and update statements or also for all other parameters?                                                               
       - shall the getDate method perform the normalization?                  
       - what about set/getObject?                                            
       - the java Docs of set/getDate don't tell anything about normalization.                                                            
       - according to which time zone shall the value be normalized?          
         - UTC                                                                
         - vm time zone?                                                      
         - database time zone?                                                                               
    3) If an automatic normalization is performed, data will be modified upon insertion (or extraction) from the database. This means that we cannot quarantee if we insert and Date object retrieve it again that the two objects will be equal.
    In the discussion with Jonathan, we couldn't clarify the issue. However, Jonathan promised that the JDK should be modified in such a way that the JDK is responsible for the normalization. (So far such a change has not been done).                                                                               
    In order to be on the safe side, SAP chose that Open SQL should reject any Date values that are not normalized. This is what we have          
    implemented and documented. I agree, that in this repect, Open SQL is stricter than the JDBC standard demands.                                                                               
    To help the application with the task to normalize a Date (and Time) object, we offer the helper class                                      
    com.sap.sql.DateTimeNormalizer which you find in opensql.jar.                                                                               
    To come to a conclusion, the bevavoir you observed is from our side not a bug of Open SQL but a feature. Please use DateTimeNormalizer to normalize Date objects appropriately.                                  
    </i>
    I hope, you can follow our reasoning.
    Best regards,
    Adrian

  • Error upon inserting data in sql Database using stream analytics job: Datatye error conversion

    I have a data passed into the Event Hubs, queried by stream analytic job inserting it into sql database. Upon running the job, it becomes idle a few seconds after since it has an error:
    Message: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64. Exception message at level [1], exception number [0], parent exception number [0]: Conversion from 0 to System.Boolean failed. 0 was of type - System.Int64.
    The data type in one of my field(IsHistorical) is Boolean with a value of false. The data type of the column in the sql table where this is to be inserted is of type bit. In this case, it seems that stream analytics could not convert the value "false"
    into a bit data type when inserting in sql table.
    I'm wondering if you already have encountered this problem. Could you help me resolve this problem?
    Thank you.

    Azure Stream Analytics does not have Boolean type. On input we will convert JSON Boolean value to bigint.
    Here is the list of supported types and conversions:
    https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx 
    You  can fix this erro by changing column type from bit to int in SQL table schema.

  • Saving data in sql database

    Ive seen same title subjects but apparently these topics have been deleted. Anyway,
    I have a data base named "TestDB", under url www.mysql.com/TestDB. I did in it 2 fields, "ProjectNr", "ProjectName".
    Now, I have Webdyn Pro app with two InputFields binded to Contexts "ProjectNr", "ProjectName" and a button "Save"
    What code do I need to write in onActionSave() part to make data written into those two fields be saved in sql database after pressing Save button.

    Hi,
    Following is the code, pl aligh that to your requirement
    try {
              Class.forName("com.sap.dbtech.jdbc.DriverSapDB");
               String url="jdbc:sapdb://<HostID>/J2E?sqlmode=ORACLE";
                Connection con=DriverManager.getConnection(url,"UserID","password");
                String projectID = wdContext.current<Yournode>Element().get<yourAttribute>();
                String projectName = wdContext.current<YourNode>Element().get<your Attribute>();
                String sql = "insert into Project values (?,?)";
                PreparedStatement stmt = con.prepareStatement(sql);
                stmt.setString(1, projectID);
                stmt.setString(1, projectName);
         } catch (Exception e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
    try to make use of JNDI for database connections. That s one of the best practises.
    http://java.sun.com/javase/technologies/database/
    Regards
    Ayyapparaj

  • Database Toolkit: Reading data from SQL database

    Hello,
    I have been working on a automated test system storing data into a SQL server database.  Once you get your head wrapped around the toolkit and walk through some of the examples it is not too bad.  Writing to the database was very straight forward.  I simply put all of my data including the primary keys into a cluster and inserted the cluster into the specified table.  As I learned the hard way,  it is very important for all of your types to match up.  I saved double type from labview as decimal type in the SQL database, and long integer in labview as integer in the SQL database. 
    For the the read VI, this is where my questions lie. After establishing a connection reference I used the "DB Tools Create Parameterized Query" VI combined with a SQL statement to find the recordset that I was looking for.  I used a standard SQL statement using the primary keys such as, "Select * From TableName Where Measurements = "%Measurements%" ".  This VI creates a command reference which I then passed to multiple "DB Tools Get Parameter Value" VIs.  I could not get this to work with the command reference. 
    I then switched over to the "DB Tools Execute Query" inputting the same SQL statement I had used before.  THis VI passed a recordset reference, which I then passed to a "DB Tools Get Properties" VI to check if the database was empty or not.  I then passed the recordset reference to multiple "DB Tools Fetch Element Data"  VI's to read the data from the SQL database.  THis worked very well. 
    therefore I am wondering:
    What is the difference between a command reference and a recordset reference in the Database connectivity toolkit? 
    Why would one work and not the other? 
    Is there ever a case when you would want to use one method over the other? 
    I have asked my app guys and Labview training instructor different database type questions, and I not received a decent answer to date.
    Thanks,
    Jackson

    Hello,
    Can you pass the command reference to a single "DB Tools Get Parameter Value" VI?  What exactly do you mean when you say you couldn't get this to work with command references... can you post an error message or the results?  The documented difference is that they are different flavors of ADOs (activeX data objects), one is a command and the other is a recordset reference.  I know this does not draw a precise distinction, but I'd like to understand this problem fully so we can find one!
    Please repost with anything more you can give!
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear

  • Insert Fixed Width data into SQL database.

    I have a file sent from a client that I need to get into a SQL database.
    The file name is ELIG and it is in a flat file, fixed width format.
    I am just going round and round how to get the data into a database using SSMS.
    Because another user is going to be doing this in the future it needs to be easy.
    I tried tasks, import data, flat file, file path and then "Fixed Width", but it puts all of it in one field.
    the data does NOT have headers either.
    I'm not good at this kind of thing so would appreciate any help I can get.
    Gee

    Yes I saw Uri's request and I'd love to comply, since this is giving me such a hard time, but the data is too sensitive and I would be shunned by my employer and thrown out into the street.
    I've been all over google trying to find a solution.  I'm still a bit of a novice, but even so, I have never found data that is so hard to normalize.  Just error after error.
    Gee
    Hi Gee,
    I can understand your issue :-)
    it is a common issue that people think that we can read minds, troubleshoot issues without having the option to test it and without any information regarding the issues. It is like going to the children doctor and ask him to treat your children without taking
    the your children to the doctor. If you can not take the children to the doctor, then you  might need to take a doctor to the your children!
    Troubleshooting can be tedious, because there may be quite some information you will need to supply. If you can not post the information in public, then maybe you need to get a private supporting, but this will cost you (your boss/company).
    Option 1: Create a case study which is based on your real issue. Use different DDL and DML (database structure and data) than the real database, and reproduce the issue in a way that you can post us the information that we need. We have
    to get the ability to reproduce the issue in our server as well, if you need our support.
    Option 2: Use the real database information with private support,
    after the supporter sign a Confidentiality agreement. If you check people profiles in the forum, then you will find that most of the supporters here are actually work as consultants and they give support on a daily
    bases. This is our job. In the forum we come to help volunteer, but
    there is a reason why people continue to pay for support. free public support do not fit all :-)
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • Insert data into sql database where the values are in an array

    Hello Experts,
    using vbscript i want to store data in MS SQL. i have prepared a script which works fine when i provide the static value but in actual i get the values in an array and now want to store values from there.
    Below is not complete code but the block in question.
    oRecordset_Working.Open "INSERT INTO tbl_work (release, version, state, Arch)" & _
    "VALUES ('5.2', '11.25' , 'Active', 'XYZ')", _
    oConnection, adOpenStatic, adLockOptimistic
    i verified the database and can see the information is feeded.
    What i really want to make work is:
    for i=0 to UBound (arrValues)
    oRecordset_Working.Open "INSERT INTO tbl_work (release, version, state, Arch)" & _
    "VALUES ('arrValues(i)')", _
    oConnection, adOpenStatic, adLockOptimistic
    Next
    logically it is incorrect as INSERT query comes inside the loop but then how can someone make it work?
    can someone help me with this?
    -KAKA-

    Here is the preferred method of inserting multiple values into multiple fields.  It is very fast and very easy to set up.
    Const adBSTR = 8
    Const adInput = 1
    Const CONNECTION_STRING = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\temp\test.mdb;Persist Security Info=False"
    Const SQL_INSERT = "INSERT INTO Table1(ID, Name, Notes) VALUES(?, ?, ?)"
    Set conn = CreateObject("ADODB.Connection")
    conn.Open(CONNECTION_STRING)
    Set cmd = CreateObject("ADODB.Command")
    With cmd
    .ActiveConnection = conn
    .CommandText = SQL_INSERT
    .Prepared = True
    ' create parameter object and assign to command object
    .Parameters.Append .CreateParameter("ID", adBSTR, adInput)
    .Parameters.Append .CreateParameter("Name", adBSTR, adInput)
    .Parameters.Append .CreateParameter("Notes", adBSTR, adInput)
    End With
    ' bind and insert values
    For i = 2 To 10
    cmd.Parameters("ID") = "ID" & i
    cmd.Parameters("Name") = "Joe" & i
    cmd.Parameters("Notes") = "My notes"
    cmd.Execute
    Next
    conn.Close
    ¯\_(ツ)_/¯

  • Retrieve data from SQL database and put into a table

    Hi all, i encountered this error while trying to create a table in 1 of my panels:
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25:{color:#ff0000} cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    ^
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25: {color:#ff0000}cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    I understand that " cannot find symbol class ResultSetTable means that i need to import something which has this ResultSetTable. I suppose my imports are sufficient and i think the error is with the package that i included.
    This package was taken from an example in a book named java database programming bible, so i assumed it is reliable and i use it for my insert statement, which had a DataInserter.
    Could someone plz help me with this? Thanks alot in advance.
    Here are the codes:
    {color:#ff0000}package jdbc_bible.part2;{color}
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class RFIDLogistics extends JFrame{
    //Components
    // public SimpleClock clock;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    some codes
    {color:#ff0000}try
    {{color}
    {color:#ff0000} DataInserter inserter = new DataInserter();
    String SQLCommand = "INSERT INTO " + flstr + " (Item_ID,Location_ID) VALUES ('"+Item_ID1+"','"+Location_ID1+"')";
    String SQLCommand2 = "UPDATE Location SET Item_ID = '"+Item_ID1+"' WHERE Location_ID = '"+Location_ID1+"'";
    inserter.execute(SQLCommand);
    inserter.execute(SQLCommand2);
    {color} JOptionPane.showMessageDialog(null, "Successful!");
    catch(ClassNotFoundException f)
    f.printStackTrace();
    catch(SQLException f)
    f.printStackTrace();
    some codes
    public JPanel rightPanel() {
    JPanel rightPanel = new JPanel();
    rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
    //Forklift title Panel
    JPanel panel6 = new JPanel();
    panel6.setBorder(new TitledBorder(""));
    panel6.setPreferredSize(new Dimension(192,33));
    panel6.add(forkliftDetails);
    //Forklift 1 Panel
    {color:#ff0000} JPanel panel7 = new JPanel();
    panel7.setBorder(new TitledBorder("Forklift 1"));
    panel7.setPreferredSize(new Dimension(192,120));{color}
    {color:#ff0000} String query = "SELECT * FROM Forklift1";
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:RFID Logistics");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    panel7.add(itemDetail1);
    itemDetail1TextField.setEditable(false);
    panel7.add(itemDetail1TextField);
    panel7.add(locationDetail1);
    locationDetail1TextField.setEditable(false);
    panel7.add(locationDetail1TextField);
    panel7.add(jt);
    {color}..
    //Main Method
    public static void main(String args[]) {
    RFIDLogistics app = new RFIDLogistics();
    app.setFrame();
    app.setResizable(false);
    app.setDefaultCloseOperation(EXIT_ON_CLOSE);
    app.setSize(1024,676);
    app.setLocation(0,60);
    app.setVisible(true);
    If you would like to try if my table can extract, here are the sample codes, just change ur database name which is highlighted in green, and the table name in blue.
    Codes:
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class sample1{
    private static JFrame frm;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    public static void main(String args[]){
    String query = "SELECT * FROM {color:#00ccff}Forklift1{color}";
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:{color:#00ff00}RFID Logistics{color}");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    frm = new JFrame("Sample");
    frm.setSize(400,400);
    frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frm.add(jt);
    frm.setVisible(true);
    }catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    Could someone plz help me with this? Thanks alot in advance.

    public JTable populateTable()
      String[] colNames = new String[] {"ID","NAME","SURNAME"};
      return new JTable(getSQLData(), colNames);
    public Object[][] getSQLData()
      stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("SELECT [ID], [NAME], [SURNAME] FROM [USERS]");
      Object[][[] out = new Object[rs.getFetchSize()][3];//Not sure on getFetchSize but it should work
      int i = 0;
      while(rs.next())
        out[0] = rs.getInt(1);
    out[i][1] = rs.getString(2);
    out[i++][2] = rs.getString(3);
    return out;
    The above code will create a JTable with the data retrieved from the DB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Auto update of date field - SQL Server 2005

    HI folks,
    Is there a way I can automatially tell when a record was last updated?
    I can set a field to get the date by using getdate(), but is there a way SQL server will insert the timestamp, without me having to create the date object in CF, then inserting it.
    I'd like to add a 'last updated' function to my CMS.
    Thanks in advance

    For UPDATE you are looking at trigger.
    http://msdn.microsoft.com/en-us/library/ms189799.aspx

  • Getting data from SQL database

    Hi
    I am stil trying to get some basic information stored in a database table on my SQL Server.
    I can do this by embedding an Applescript do carry out the shell command 'curl' as below:
    myFullScriptString = "do shell script \"curl -0  localhost/asset.php?asset_id="+assetID+"\"";
    myForceError = app.doScript(myFullScriptString, ScriptLanguage.APPLESCRIPT_LANGUAGE);
    return(myForceError);
    but I dont want to be limited to OSX.
    Is there a way this can be put into a native socket comment using a structure as below?
    reply = "";
    conn = new Socket();
    conn.open("192.168.91.184:8888");
    conn.write(" GET /myfile.php?" + variousVariable + " HTTP/1.0\n\n");
    reply = conn.read(999999);
    conn.close;
    Cheers
    Roy

    Sigh...
    I'm sorry, Roy, I really thought that the example in the JS Tools Guide told you how to seperate the actual response from the server's headers. But it doesn't!
    Anyhow, RFC2616 tells us:
    6 Response
       After receiving and interpreting a request message, a server responds
       with an HTTP response message.
           Response      = Status-Line               ; Section 6.1
                           *(( general-header        ; Section 4.5
                            | response-header        ; Section 6.2
                            | entity-header ) CRLF)  ; Section 7.1
                           CRLF
                           [ message-body ]          ; Section 7.2
    So, that means the message body is seperated by two CRLF pairs. Except that because of API magic each CRLF turns into a single \n. So you want to look for \n\n.
    So, you should be able to seperate it like this:
    body = reply.substr(reply.indexOf("\n\n")+2);

  • Update UnderLine Data in SQL Server

    hi...
    i have "startBalance" Table that contain  startBalance Stock and price 
    my application calculate the cost price based on inventory average cost price , after 4 months of work the user figure out that the start price is wrong and want to update it , but i can't do it because i have "ItemHistory" that contain the history
    of stock and price of an item , if the user update the start price i have to update all item costprice history can some one tell me how to do it ?
    Thanks for attention .

    There is no other way around to skip updating costprice history. For each item in the the "startBalance" table you need to recalculate the itemHistory average cose price information by joining the two table. What is the relation between the the two table
    i.e startBalance & itemHistory. Please post table definition and calculation formula.
    Regards, RSingh

  • How to load my tree with data from SQL database????

    Hello friends
    May i know how i can load my tree with my database??
    i have 3 different tables and i need them to be the 3 main nodes of my tree
    They are
    1.fiche
    2.amis and
    3.famille
    and in each of these nodes need to load the 3 databases
    thank u in advance

    Heres my program so i loaded my vector ,
    Now how can i integrate the coding u gave me, and where ??
    Is it where i put the quetion mark?
    if so
    can you tell me how?? because i didnt understood well the codings you gave me as im nt at all familiar with this
    Thank you in advance
    public class carnetf extends javax.swing.JFrame  {
       DefaultMutableTreeNode root =null;
        public carnetf() {
           root= new DefaultMutableTreeNode("Carnet");
            DefaultMutableTreeNode tnFiche=new DefaultMutableTreeNode("Fiche");
           root.add( tnFiche);
            DefaultMutableTreeNode tnAmis=new DefaultMutableTreeNode("Amis");
            root.add( tnAmis);
            DefaultMutableTreeNode tnFamille=new DefaultMutableTreeNode("Famille");
            root.add( tnFamille);
           initComponents();
        public Vector vecfiche() {
            Vector v = new Vector();    
            Connection connection = null;
            try
                Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
                DriverManager.registerDriver(new com.microsoft.jdbc.sqlserver.SQLServerDriver());;
            catch (Exception E)
                System.out.println("Unable to load driver.");
                System.out.println(E.getMessage());
                E.printStackTrace();
                return null;
            try
                connection = DriverManager.getConnection( "jdbc:microsoft:sqlserver://localhost:1433;user=sa;password=sa;DatabaseName=carnet");
            catch (Exception E)
                System.out.println("Unable to connect.");
                System.out.println(E.getMessage());
                return null;
            try
                Statement Stmt = connection.createStatement();
                if(jRadioButton1.isSelected()==true)  
                    String Query = "SELECT * FROM fiche";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Nom"), RS.getString("Prenom")));
                if( RS!= null) RS.close();}
                if(jRadioButton2.isSelected()==true)  
                    String Query = "SELECT * FROM amis";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Anom"), RS.getString("Aprenom")));
                if( RS!= null) RS.close();}
                if(jRadioButton3.isSelected()==true)  
                    String Query = "SELECT * FROM famille";
                ResultSet RS= Stmt.executeQuery( Query );
                while ( RS.next())
                 v.add( new vecfiche( RS.getString("Fnom"), RS.getString("Fprenom")));
                if( RS!= null) RS.close();}
                if( Stmt!= null) Stmt.close();
            catch (Exception E)
                System.out.println("Unable to query.");
                System.out.println(E.getMessage());
                return null;
            try
                connection.close();
            } catch (Exception E)
                System.out.println("Unable to close.");
                System.out.println(E.getMessage());
                return null;
            return v;
        }

  • Updating data in mulitple databases

    Hi,
    I have a requirement in my project to update the data in two databases, when user updates data in the screen and saves it. We are using stateless session EJB to call the DAO. The update is using normal JDBC update statement.
    If some thing goes wrong in update stmt in any of the database, does EJB has capability to rollback the update in another database as well. As both are in single transaction.
    Pls advise on this. Your help is appreciated.
    Thanks
    Kumar.

    ... I only added this constructor to be able to run your code:
        public fillDbGui(){
            setTitle("Fill DB GUI");
            setSize(600,500);
            setLocationRelativeTo(null);
            try{
                DriverManager.registerDriver( new com.mysql.jdbc.Driver() );
                DriverManager.registerDriver( new sun.jdbc.odbc.JdbcOdbcDriver() );
                connection = DriverManager.getConnection(DATABASE_URL, DATABASE_USER, USER_PASSWORD);
                conc = connection.createStatement();
                System.out.println("Successfully connected to database '" +DATABASE_NAME+ "'\n");
            }catch(SQLException ex){
                System.out.println("Connection failed\n");
                JOptionPane.showMessageDialog( this, ex.getMessage(),
                        "Fill_DB_GUI:   SQLException", JOptionPane.ERROR_MESSAGE);
            db2vector();
        public static void main(String args[]) {
            new fillDbGui().setVisible(true);
        private final String DATABASE_NAME = "test";
        private final String DATABASE_URL =  "jdbc:mysql://localhost:3306/" + DATABASE_NAME;
    //    private final String DATABASE_URL = "jdbc:odbc:" + DATABASE_NAME;
        private final String TABLE_NAME = "testuhrand";
        private final String DATABASE_USER = "root";
        private final String USER_PASSWORD = "sql";
        private Statement conc;
        private Connection connection;

Maybe you are looking for

  • InDesign CS5 crashing on 2012 MacBook Pro

    I have a 2012 MacBook Pro and am running CS5. My InDesign keeps crashing every time I try to open it. After googling the issue, it appears that happened to a lot of people running CS5 on a 2012 MacBook Pro. Does anyone know how to easily resolve this

  • Can't download word docs or PDF's from Google Docs

    I cannot download word docs or pdf's from Google docs.  I can download MP3's. I get an error message saying IE can't find the website. The google docs forum response to this problem was to uninstall the current version of Flash and install Flash 10.1

  • I need a program to create a website. Is there iweb? Thank you

    I need a program to create a website. Is there iweb? Thank you Beautiful

  • Incredibly stuck!!

    So, recently I tried to install my printer to my MacBook, but it wouldn't take my password, and I decided to exit the installation process, and it came up with many different windows of applications and information I didn't need. I then attempted to

  • Password Manager 4.10 forced to foregound

    I use Windows 7 Pro and a ThinkPad X230 One of the products i install is Thinkvantage Password manager 4.10. When I start Lotus Notes as a user the welcome and password prompt will appear. Behind that screen a TV Password Manager screen is displayed