Oracle table(s) data to INSERT(String) statements with JAVA

Hi,
How can I get sql inserts from a oracle table with JAVA?
Is there a Oracle API for it?
I need to store it in a file, the result file should have these examples lines:
-- INSERTING into TEST
Insert into "TEST" ("CODE","FAMILY","SUB_FAMILY","SEVERITY","STATUS","ANOMALY_DATE","DESCRIPTION",
"COMMENTS","VALUE0","VALUE1","VALUE2","VALUE3","VALUE4","VALUE5","VALUE6","VALUE7","VALUE8",
"VALUE9") values (1,'family1','subFamily11','bad','initial',to_date('0005-11-21','DD/MM/RR'),'someDescription',
'someComment','someValue','someValue','someValue','uselessValue','uselessValue',null,null,null,null,null);
the example line was created with the export tool from Oracle SQl developer
Thks.
Francisco

user9046632 wrote:
Hi Guys, this is me Francisco that wrote the first question, but now I've an NEW account. I'll try to explain it. For a Job I need a .txt file that contains the SQl string inserts from an Oracle Table. I can't use a Software because I need to do it with Java Code. I'm not trying to get the inserts's logging , I need a to export it from a table.I read One way to do it is using DataPump utility, but using this tools, will I get a text file? I read that DataPump works with binaries files. using Java JDBC and metadata, I need to convert all in String file, ok for it I'm agree, but I have to write a lot of code to know what kind of type I get from the Table to parse it. One example is with Date types, oracle softwares parse it as to_date('0005-11-21','DD/MM/RR') and java toTostrig will do it something like '2009-1-25 13:00:00'. Java toString method will truncate some Number types So I need to know if someone did it or give or can help me.
Thank you very much. Francisco
Again, explain the business problem you are trying to solve, not the technical one. WHY do you need a text file that contains "SQL string inserts"? It sounds very much like you are looking at your problem "through the wrong end of the telescope" and thus finding a poorly designed solution. But unless we know the real problem to be solved, it's hard to say any more than that this smells bad.
Sorry about my English, it's not my natural language

Similar Messages

  • How-To "Refresh a table of data after inserting or deleting"

    I'd like to say a word on the how-to article "How to refresh a table of data after inserting or deleting a row using ADF".
    (http://www.oracle.com/technology/products/jdev/howtos/1013/updtable/index.html?_template=/ocom/technology/content/print)
    I spent a lot of time on it because I needed help in implementing simple CRUD functionality on a table, using JSF-ADF-TopLink technologies.
    While the the article does provide correct steps, it is in one important place not specific enough, so the reader may easily get stuck. In section "Refresh the data table", point 1: when you double click on the removeEntity() button, in Structure window, then you do not get the required dialog. You get CommandButton Properties dialog.
    You must click on the removeEntity() button in Editor's Design view. But even there you may get the CommandButton Properties dialog, not managed beans dialog.
    You may resolve that by going to JSF configuration file, faces-config.xml, and switch to Overview view. This will show you the managed beans that you have.
    Then, you may already have a backing bean for the page. You can use that and avoid creating a new managed bean.
    I could understand what the operations mean only after very careful reading of "Creating More Complex Pages", section "Overriding Declarative Methods" in JDeveloper Help (or in ADF Developer's Guide PDF document).
    In general: I believe that "ADF bindings" need more conceptual explanation, maybe in form of an article. Grammatical form "bindings" may create a false understanding that "bindings" are just references. But they are not -- ADF bindings are active objects that handle traffic between UI components and Data Controls. It seems that "bindings" even communicate among themselves. Maybe it would be more understandable to differentiate strictly between "binding objects" (or "binders"?), binding object definitions and binding object references.
    It would be very helpful to have a diagram showing grahically what specific binder objects are created in a small apllication (2-3 pages using 1-2 tables), with whom they communicate and what type of data is passed on.
    Priit

    Hi
    Thanks for your infos.
    Yes exactly I use almost the same code you have post here.
    Could You answer to my next questions?
    First - >what do you mean by saying that "it's not good idea using refreshing in IE?" Of course I use refreshing in backing_bean for my button "remove" that removes row, commit changes to database and refresh table, almost the same as You said in your post:
    Code in backing_bean is and comments on difference to Your code is below:
    public commandButton2_action1(){
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("removeEntity");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    //above remove entity, but I dont now if it do commit to database? So i do it below
    OperationBinding commit1 = bindings.getOperationBinding("Commit");
    commit1.execute();
    //and at the end I refresh my table, "findAllRezerwacja1 - it is an id of the methodAction, not the iterator -> is it ok? or should I change to Iterator id?
    OperationBinding requery = bindings.getOperationBinding("findAllRezerwacja1");
    requery.execute();
    return null;
    Page Definition code for this:
    <methodAction id="findAllRezerwacja1"
    InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" MethodName="findAllRezerwacja"
    RequiresUpdateModel="true" Action="999"
    ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_findAllRezerwacja_result"/>
    <table id="findAllRezerwacja2" IterBinding="findAllRezerwacja1Iter">
    <AttrNames>
    <Item Value="dataDo"/>
    <Item Value="dataOd"/>
    <Item Value="idRezerwacja"/>
    <Item Value="liczbaUczestnikow"/>
    <Item Value="prowadzacy"/>
    <Item Value="uwagi"/>
    </AttrNames>
    </table>
    <methodAction id="removeEntity" InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" MethodName="removeEntity"
    RequiresUpdateModel="true" Action="999">
    <NamedData NDName="entity"
    NDValue="${bindings.findAllRezerwacja2.currentRow.dataProvider}"
    NDType="java.lang.Object"/>
    </methodAction>
    <action id="Commit" IterBinding="findAllRezerwacja1Iter"
    InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" RequiresUpdateModel="true"
    Action="2"/>
    </bindings>
    //and rest of code for Iterator etc
    My second question is, why when you use refresh button in IE (I know is not recommended as You said, but sometimes user do it, so I want prevent situations that I will describe here) so when I press refresh button in IE exactly after removing one row by clicking my button, refreshing by pressing IE button is doing the same --> is deleting next row. How to stop deleting row, when for example user would press IE refresh button after pressing remove button for table. If I change selection in table after deleting row, and press refresh button in IE, instead of deleting row, I got error message: JBO-29000: JBO-35007: and
    JBO-35007. So where Im doing wrong. Maybe I should do sth with postback ? Could You help me? Thanks in advance
    Last one question: what is the difference between using delete and removeEntity from operations node? Im now reading carefully ADF Dev Guide, so I hope I can find infos there? But if You know, please answer to this question.
    Thanks

  • ORA-00054 error when loading Oracle table using Data Services

    Hello,
    we are facing ORA-00054 error when loading Oracle table using BO Data services
    (Oracle 10g database, BODS Xi 3.2 SP3)
    Test Job performs
    1- truncate table
    2- load table (tested in standard and bulk load modes)
    Scenario when issue happens is:
    1- Run loading Job
    2- Job end in error for any Oracle data base error
    3- When re-running the same Job, Job fails with following error
         ORA-00054: resource busy and acquire with NOWAIT specified
    It seems after first failure, Oracle session for loading the table stays active and locks the table.
    To be able to rerun the Job, we are forced need to kill Oracle session manually to be able to run the Job again.
    Expected behaviour would be : on error rollback modifications made on table and BODS stops Oracle session in a clean way.
    Can somebody tell me / or point me to any BODS best practice about Oracle error handling to prevent such case?
    Thanks in advance
    Paul-Marie

    the ora-0054 can occure depending how the job failed before. If this occures you will need the DBA to release the lock on the table in question
    Or
           AL_Engine.exe on The server it creates the Lock. Need to Kill Them. Or stop it..
    This Problem Occurs when we select The Bulkloading Option in orclae  We also faced the same issue,Our admin has Killed the session. Then everything alright.

  • How to export Oracle tables and data to mySQL

    Hi,
    I am new to Oracle.. and would appreciate all help on the issues below.
    Currently, we have Oracle8i on HP-UX, and Oracle8i on IBM-AIX. We would like to be ble to browse the information on the web, thus, a decision to use mySQL as the web database was made. In order to achieve the above, we need to perform the following:
    1) Export Oracle tables to mySQL, from both the HP-UX and IBM-AIX machines.
    2) Include an additional column to the tables that need to be exported from Oracle to mySQL.
    3) Implement the export as a daily extraction that will run at a certain time of the day.
    How may I achieve the above?
    I have just installed the Oracle Enterprise Manager... will this have any help to the above???
    Appreciate all help given... greatly appreciated!
    Thanks and Brgds,
    Alicia

    I'd first make sure you really need to create a separate database just for making the data available to the web. The web application you create could just as well query the existing Oracle databases. You don't necessarily have to create a separate database just to display info over the web.
    Secondly, if you still want to create a separate database, I'd also question the use of mySQL. In my opinion, mySQL is not a relational database. It acts like a relational database; you can query it via SQL. But because of all the features which mySQL says it does not support yet, I don't consider it to be a true RDBMS. This may not be an issue in your case since you're using it just for read access. Still, I'd take a long look at the list of feature mySQL does not support and make sure you can live with those limitations.
    Also, if you create a separate database for the web app and use Oracle for that database instead of mySQL, you could use Oracle's built in data replication to automatically refresh the web db from the existing db
    If you conclude that you still want to create a separate database for the web app and use mySQL I think you'll have to write some code to support the interface between the dbs (but hey, I'm a developer). The reason I say this is because it sounds like you're merging data from two databases into one and you may even be merging data from two separate databases into a single table of the new web database. If this is the case, simple data extract utilities will not be sufficient. Also, it sounds like the new column added to the web database may not be able to be populated from existing data. And then there's the question of what you need to do with the existing web data each time you run the data extraction ? The easiest case is that you'll always add data to the web db from existing db. If you have to purge the web db first and then refresh it with existing data then there's another step in the process. Overall, writing code to support an interface like this gives you complete control over the process and provides a lot of flexibility in how it is run. In my experience, there are usually new requirements added to the interface as time goes on. The code based approach can deal with changing requirements. The tools approach eventually falls short.
    One other issue to keep in mind is how to protect your existing database while exposing your web database to the Net. Since you need to support an automated interface between the two systems, you'll need to provide a path between the two databases without letting Net users gain access to your internal database. Some serious network security issues to resolve here, but I'm not a network admin.
    hth,
    Frank
    Hi,
    I am new to Oracle.. and would appreciate all help on the issues below.
    Currently, we have Oracle8i on HP-UX, and Oracle8i on IBM-AIX. We would like to be ble to browse the information on the web, thus, a decision to use mySQL as the web database was made. In order to achieve the above, we need to perform the following:
    1) Export Oracle tables to mySQL, from both the HP-UX and IBM-AIX machines.
    2) Include an additional column to the tables that need to be exported from Oracle to mySQL.
    3) Implement the export as a daily extraction that will run at a certain time of the day.
    How may I achieve the above?
    I have just installed the Oracle Enterprise Manager... will this have any help to the above???
    Appreciate all help given... greatly appreciated!
    Thanks and Brgds,
    Alicia

  • INSERT INTO statement in java servlet.

    Hiya
    Was wondering if anyone knew how to use variables from an html form into a sql insert into statement? The constants work ok below, its just getting the variables to work.
    //constants work ok.
    rs = stmt.executeQuery("INSERT INTO ACCOUNTS " + " VALUES ('un', 'test2', 'test2', 'test2', 'test', 'test', 'test', 'test', 'test')");
    //doesn't do anything no errors.
    rs = stmt.executeQuery("INSERT INTO ACCOUNTS " + " VALUES ( '"+uname+"', " + " '"+fname+"', " + " '"+sname+"'," + "'"+address1+"'," + "'"+address2+"'," + "'"+town+"'," + "'"+county+"'," + "'"+postcode+"')");

    <html>
    <head>
    <title>
    CreateAccount
    </title>
    </head>
    <body>
    <form method=get action=/servlet/website.CreateAccount>
    <p> Username:
    <input type=text name="username"> </p>
    <p> Password:
    <input type=text name="password"> </p>
    <p> First Name:
    <input type=text name="firstname"> </p>
    <p> Surname:
    <input type=text name="surname"> </p>
    <p> 1st Line of Address:
    <input type=text name="1address"> </p>
    <p> 2nd Line of Address:
    <input type=text name="2address"> </p>
    <p> Town:
    <input type=text name="town"> </p>
    <p> County:
    <input type=text name="county"> </p>
    <p> Postcode:
    <input type=text name="postcode"> </p>
    <input type=submit>
    </form>
    </body>
    </html>
    package website;
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class CreateAccount extends HttpServlet {
      private static final String CONTENT_TYPE = "text/html";
      /**Initialize global variables*/
      public void init(ServletConfig config) throws ServletException {
        super.init(config);
      /**Process the HTTP Get request*/
      public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {
        ResultSet rs = null;
        Connection con = null;
        res.setContentType("text/html");
        PrintWriter out = res.getWriter();
        //get the variables  entered in the form
        String uname = req.getParameter("username");
        String pwd = req.getParameter("password");
        String fname = req.getParameter("firstname");
        String sname = req.getParameter("surname");
        String address1 = req.getParameter("1address");
        String address2 = req.getParameter("2address");
        String town = req.getParameter("town");
        String county = req.getParameter("county");
        String postcode = req.getParameter("postcode");
        try {
          // Load the database driver
          Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
          // Get a Connection to the database
          con = DriverManager.getConnection("jdbc:odbc:account", "", "");
          //Add the data into the database
    try
                String sql = "INSERT INTO ACCOUNTS " + " VALUES (?,?,?,?,?,?,?,?)";
                PreparedStatement statement = con.prepareStatement(sql);
                statement.setString(1, uname);
                statement.setString(2, fname);
                statement.setString(3, sname);
                statement.setString(4, address1);
                statement.setString(5, address2);
                statement.setString(6, town);
                statement.setString(7, county);
                statement.setString(8, postcode);
                int numRowsChanged = statement.executeUpdate(sql);
                statement.close();
    //Statement stmt = null;
    //stmt = con.createStatement();
    //Create a Statement object
    //constants work ok.
    //rs = stmt.executeQuery("INSERT INTO ACCOUNTS " + " VALUES ('uname', 'test2', 'test2', 'test2', 'test', 'test', 'test', 'test', 'test')");
    catch (Exception e)
          // show that the new account has been created
          out.println("<p> New account created: </p>");
          out.println(" '"+uname+"'");
        catch(ClassNotFoundException e) {
          out.println("Couldn't load database driver: " + e.getMessage());
        catch(SQLException e) {
          out.println("SQLException caught: " + e.getMessage());
        finally {
          // Always close the database connection.
          try {
            if (con != null) con.close();
          catch (SQLException ignored) { }
    }ok now the regular statement with constant values inserts data into the database (the regular statement is being used with a result set ) but the prepared statement does not - there are no error messages but it does not insert any data either. The data is going into the variables due to the system.out.println, but is it going into the prepared statement? I believe the prepared statement is being executed with the executeupdate method.

  • Is it possible to insert data into a MySQL database with Java?

    Hello everyone!
    I would like to know, if it's possible to insert data into a MySQL database, with a JFrame inside a servlet?
    When the JFrame is first created it calls this method:
         * Connects the servlet with the MySQL database.
        private void connect(){
            try{
                Class.forName("com.mysql.jdbc.Driver");
                connection = DriverManager.getConnection(
                        "jdbc:mysql://localhost:3306/data", "root", "omfg123");
            }catch(ClassNotFoundException cnfe){
                cnfe.printStackTrace();
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }Then, when you click the "Add" button, it executes this code:
                add.addActionListener(new ActionListener(){
                    @Override
                    public void actionPerformed(ActionEvent ae){
                        String employee = employeeName.getText();
                        String[] args = employee.split(" ");
                        firstName = args[0];
                        lastName = args[1];
                        execute();
                });And this is my "execute()" method:
         * Connects the servlet with the MySQL database.
         * - And executes the SQL queries.
        private void execute(){
            try{
                PreparedStatement statement = connection.prepareStatement("insert" +
                        " into employees values(" + firstName + ", " + lastName
                        + ")");
                ResultSet result = statement.executeQuery();
                String fullName = firstName + " " + lastName;
                printer.write("Employee " + fullName + " added.</br>");
            }catch(SQLException sqle){
                sqle.printStackTrace();
        }But when I click the "Add" button, nothing happens.

    This is what I use to insert into mysql. It works on windows.
    try {
                Class.forName("com.mysql.jdbc.Driver");
                String connectionUrl = "jdbc:mysql://" + loadip + "/custsig?" +
                        "user=root&password=";
                Connection con = DriverManager.getConnection(connectionUrl);
                newproc = jTextField1.getText();
                newsoft = jTextField2.getText();
                newdeb = jTextField3.getText();
                newcust = jTextField4.getText();
                if (newcust.equals("")) {
                    errorsig12 = 1;
                    jLabel1.setForeground(new java.awt.Color(255, 0, 0));
                } else if (newsoft.equals("")) {
                    errorsig12 = 1;
                    jLabel2.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newproc.equals("")) {
                    errorsig12 = 1;
                    jLabel3.setForeground(new java.awt.Color(0, 0, 0));
                } else if (newdeb.equals("")) {
                    errorsig12 = 1;
                    jLabel4.setForeground(new java.awt.Color(0, 0, 0));
                if (errorsig12 == 0) {
                    PreparedStatement ps = con.prepareStatement("insert into customer set cust_name = ?,  software = ?, processor = ?, debit = ?");
                    ps.setString(4, newdeb);
                    ps.setString(3, newproc);
                    ps.setString(2, newsoft);
                    ps.setString(1, newcust);
                    int rs = ps.executeUpdate();
            } catch (SQLException eg) {
                System.out.println("SQL Exception: " + eg.toString());
            } catch (ClassNotFoundException cE) {
                System.out.println("Class Not Found Exception: " + cE.toString());
            }

  • Update oracle table using data through ODBC

    Hi,
    I want to update tables inside an Oracle 8i database.
    The updates depend on data in a mySql database that I want to approach using an ODBC connection.
    I cannot figure out what I need to do to select data from an ODBC source from an oracle session.
    What do I have to call this external table ...
    Edward

    The following link may be relevant. Check it out.
    http://download-east.oracle.com/docs/cd/A87860_01/doc/server.817/a76960/hs_admin.htm

  • Oracle Table for 'Date Effectivity To' field in Bill Of Materials Screen

    Hi Apps Gurus,
    In Oracle EBS Bill Of Materials Screen under the tab Date Effectivity, there is column: 'To' which indicates the end date upto which the BOM is active.
    I want to know the base table in which this Date Effectivity To field is located in , i tried help--> diagonostics but this particular field is not present in the view given.
    Almost all fields at BOM component level are present in bom_inventory_components table except this effective date to field.
    Please advice as to in which table is this field present.
    Thanks,
    RG

    Hi RG,
    These both fields EFFECTIVITY_DATE & DISABLE_DATE are available in base table : BOM_COMPONENTS_B
    SELECT EFFECTIVITY_DATE, DISABLE_DATE FROM BOM_COMPONENTS_B WHERE BILL_SEQUENCE_ID = :p_bill_seq_id
    HTH
    Sanjay

  • How to refresh a table of data after inserting a row using ADF BC

    Hi,
    i am using ADF BC, JSF to construct a page to browse and another to create/update record. But after creating or updating the record it is not reflected when i come back to browse page.
    I tried to insert invokeaction in page definition page but i can not find the iterator bindings for that table in Binds option.
    can any one provide any example how to do it.
    Please help me.

    On the page def for your submit page, add inside the executables (on the structure pane) your iterator you want refreshed (if it isn't already there).
    Then double click on the submit button and bind it to a backing bean. My method in the backing bean looks like:
        if ( !operationBinding.getErrors().isEmpty() )
            return null;
        DCBindingContainer dcbindings = (DCBindingContainer)bindings;
        DCIteratorBinding appsIter = dcbindings.findIteratorBinding("ApplicationsIterator");
        appsIter.executeQuery();
        return null;
    }The executeQuery method will refresh that iterator for your return page. The "ApplicationsIterator" is what the structure pane calls your iterator. Works for me.
    Brian

  • Insert Statement with JAVA

    I'm trying to insert Data into an access table. Moreover, I'm able to retrieve data on the table (to prove that I'm connecting fine)... I just can't insert Data
    try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con = DriverManager.getConnection(url);
                   System.out.println("Connection Successful");
                   Statement st = con.createStatement();
                   ResultSet rs = st.executeQuery("INSERT INTO Worker VALUES ('" + strDataName + "', '" + strDataDept + "', '" + dblDataHoursWrked + "', '" + dblDataHourlyWage + "', '" + dblDataPay + "')");
                   rs.close();
                   processQuery(con, st); // does what is nessesary to complete the current request
                   st.close();
                   con.close();
              catch (ClassNotFoundException e)
                   System.out.println("failed to load OBCD driver. ");
                   System.out.println ("Class errros: " + e);
              }For some reason, I don't have any errors Its just not inserting the data to the table.. any help would be greatly appreciated

    try
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con = DriverManager.getConnection(url);
                   System.out.println("Connection Successful");
                   Statement st = con.createStatement();
                   //ResultSet rs = st.executeQuery("SELECT INTO Worker VALUES ('" + strDataName + "', '" + strDataDept + "', '" + dblDataHoursWrked + "', '" + dblDataHourlyWage + "', '" + dblDataPay + "')");
    Here use update query "executeUpdate("UPDATE TABLENAME SET COLUMN=VALUE,.........................WHERE CANDITION );
    rs.close();
                   processQuery(con, st); // does what is nessesary to complete the current request
                   st.close();
                   con.close();
              catch (ClassNotFoundException e)
                   System.out.println("failed to load OBCD driver. ");
                   System.out.println ("Class errros: " + e);
    U CHECK IT ,I THINK IT WILL WORK

  • Excel data issue of string mixed with number or decimal

    I have an excel file (.xls) from the client. The file only has one column Name. For some reasons, a couple of data are number or decimal (see the following example).
    Name
    abc
    xyz
    123
    3.98
    When I tried to import data to the table (mssql 2008) (one column with nvarchar(255)), I got the error:
    The column status returned was: "The value violated the integrity constraints for the column.".
    I had to open the file and added ' before the number or decimal 
    Name
    abc
    xyz
    '123
    '3.98
    Although it worked this way, it is not a good way. Any good suggestions to do it without modifying the file? Thanks.
    A Fan of SSIS, SSRS and SSAS

    That may be because you didnt set IMEX = 1 
    You have to set it to enable Excel to correctly determine data for intermixed datatypes
    see
    http://visakhm.blogspot.in/2013/01/excel-issues-in-handling-intermixed-data.html
    http://blog.concentra.co.uk/2013/05/15/why-ssis-always-gets-excel-data-types-wrong-and-how-to-fix-it/
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Execute Command "Update Data" of dynamic graphic xls with Java?

    hi, i want to write datas in tthe xls sheet, i have in other sheet from same file xls a dynamic graphic, and i want to update de graphic with the new datas writed, how can to execute the command "Update Data" in the dynamic graphi sheet??
    tnk for your help.
    HL

    You missed a space in the string after your WHERE clause.
    put an extra space after the 'WHERE' in your execute immediate statement.
         EXECUTE IMMEDIATE
              'UPDATE '|| affectedtable|| ' SET '|| affectedcol || '= :nvalue'||
              ' WHERE '|| affectedcol || '= :ovalue'
              USING newvalue, oldvalue ;

  • Writting a SQL statement with Java

    Hello,
    I would like to perform an interrogation of my database but I have some trouble... here is the code I use (with MySQL) :
    String requete = "SELECT * FROM produit WHERE NomChimique ='butanol'";
    rs = stmt.executeQuery (requete); With this requete I find the record I have in my db. But with the following string the record is not found String requete = "SELECT * FROM produit WHERE NomChimique ='(+)-2-BUTANOL'";What I have not understand ?
    Thank you for your help,
    Jean-Marie

    I perform a first SELECT statement without WHERE,
    then I copy and past the value of the two exemples I
    give, the first succed, the second not...
    I am a little bit disappointed
    Jean-Marieyou should only be disappointed in yourself. this is NOT a Java problem. this is a Jean-Marie problem.
    one of the following is true...
    - the record does not exist
    - you are fouling up the result set handling and not noticing the record
    - something is going wrong with your query parsing
    So...
    make sure it exists.
    make sure you are connecting to the database you think you are.
    check over your result set code
    use preparedstatements
    ff all those fail then post your code (USING THE CODE TAGS) and someone will be delighted to help.

  • Unicode strings (Japanese) with java 2

    I have made a program with java 1.1.8 where I can paste in Japanese words from the clipboard. View them correctly in the JTextField, save them to file, read from file and display them. To get it to function I had to install a Japanese font, change the version of the font.properties file to the japanese version, and set the font in the text field to SansSerif.
    Now I have converted my program to java 1.3.1, changed the font.properties file, but in when I try to paste in Japanese letters they look like squares.
    It seems to be a Java 2 problem. A tiny test program using swingall.jar works OK with jre but not with java 1.3.1.
    Is there anybody who knows how to handle this with java 2?
    Gunnel

    better visit this web page, this might helf
    www.unicode.com

  • How Can I Get The Cpu State With Java?

    are there any method to use??
    what's more,I also wanna to know how can I get
    the current ram that the System is using
    and the threads the System are running?
    Will you please share your knowledge here or
    write to tell me at [email protected]?
    Thanks!!

    if you know how to do this in c++, you can write native methods and use them in java.
    native methods forum:
    http://forum.java.sun.com/forum.jsp?forum=52
    tobias

Maybe you are looking for

  • How do you change the afp path "server" name on a non-server version of OS-X?

    I'm talking about the name listed after "afp://" which is shown at System Preferences>Sharing>select "File Sharing" on left, look at text under the words "File Sharing: On" where the text starts with "Other users can access shared folders on this com

  • The Weather Channel is gettign on my nerves

    Intellicast app. Both Android and iOS - sorry, WM, no one knows how to program for you :`(

  • Swatch / pattern alignment

    I have a pattern I use frequently that is a B&W diagonal stripe. This is used in fairly small areas and for print (as shading for bar graphs and such). Recently my client noted that where the pattern tiles, the ends of the lines do not align perfectl

  • Appearance Manager 1.0.2 or 1.0.3?

    Where can I download Appearance Manager 1.0.2 or 1.0.3, transfer it from my pc to my mac? Because I found some links, but they wont expand in stuffit (in my mac (IIvx))

  • Recovery not showing drives

    I am not seeing the recovery utiltiy when using Command R at startup -it goes to Internet Recovery instead.  The flah drive is fine and my time machine drive is working and connected and appear when restarting whith option.  Yet these do not show up