JDBC Statement.executeBatch() sometimes retrun NULL????

WHY???? DataBase is ORACLE8.1.7
i use PreparedStatement to executeBatch()
and DatabaseMetaData.supportsBatchUpdates() = true
but sometimes executeBatch() = NULL !!!!
is this respect with ORACLE parameter?

thanx for nobody's help.
i solved problem. it is a synchronization problem.
public synchronized void getTable(JTable theTable){
try {
String sql="SELECT ";
stmt=connection.createStatement();
rs=stmt.executeQuery(sql);
displayRS(rs,theTable);
stmt.close();
catch (Exception e ) {
e.printStackTrace();
}

Similar Messages

  • Batching disparate JDBC statements

    I am trying to batch execute a bunch of JDBC statements which are disparate - ie. insert , update. Is there a way to do this via Oracle's Thin JDBC driver? Someone mentioned that it might be possible using Oracle JDBC Callable statement interface to bunch together a bunch of SQL statements(not stored procedures) - but i could not find any information on this.
    Thanks

    Seems like you are making it harder than it needs to be. What is wrong with JDBC batching or even Oracle Style batching?
    PreparedStatement psIns = con.prepareStatement( <some insert statement> );
    PreparedStatemetn psUpd = con.prepareStatement( <some update statement> );
    for ( int at = 0; at < numRecsToInserAndUpdate; ++at )
        psIns.setLong( 1, uids[at] );
        psIns.setBlah( 2, ... );
        psIns.addBatch();
        psUpd.setString( 1, updateStrings[at] );
        psUpd.addBatch();
    psIns.executeBatch();
    psUpd.executeBatch();The above example uses JDBC style batching, you can as easily do this with Oracle style batching.
    R.

  • JDBC Adapter configuration not initialized:null

    i
    we have a synchronous scenario with the following adapters , RFC <> XI <> JDBC.
    1.JDBC Driver installation is done
    2.RFC Destination type t is done in sap(sender) system.
    3.checking the jdbc in VA is done
    while running it is giving the following error.
    com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null
    where we have to initialize JDBC Adapter configuration
    Thanks in advance
    Prasad Nemalikanti

    hi prasad
    There are 2 jar files that may be missing from your SQL JDBC driver --> msbase.jar and msutil.jar, I think once you add these to the driver it might work.
    also check  the driver string for the SQL  driver 2 parameters
    i.e 'com.microsoft.jdbc.sqlserver.SQLServerDriver' now becomes
    'com.microsoft.sqlserver.jdbc.SQLServerDriver'
    This will solve your problem
    follow this link
    Re: MS SQL Server jdbc Driver installation on XI .
    XI JDBC Adapter using stored procedures
    thanks
    sandeep
    Reward points if helpful

  • How to insert an image file as blob using JDBC Statement

    Hi,
    I'm new on java.
    I want the code to insert an image file in Oracle database whose data type is blob.
    i want to use JDBC statement not the prepared statement.
    Please help me out.

    user8739226 wrote:
    thanks for the solution.
    I want to ask one thing
    let say i've created a method in a bean in which i'm passing three parameters.
    One is tablename as String, Second is Name of tablefields as Object, Third is Values as Object
    Like:
    public synchronized int insert(String table,Object[] fields, Object[] values)Ah now we're getting somewhere. I was trying to come up with a situation where using a regular Statement over PreparedStatement would be viable and came up with practically nothing.
    In the method body i'm accessing the table fields and values and combining them into the insert sql query.
    how can i do this using preparedstatment.
    how do i come to know here in this bean that this value is int or string or date at runtime to use setInt, setString, setdate or setBlob respectively.That's your problem. Bad design. You want to make some sort of universal insert method that can insert anything anywhere. But it doesn't really make sense, because whenever you're trying to insert something, you know exactly what you want to insert and where. You could use a PreparedStatement at that point (although encapsulate it in its own method). Now you're trying to create your own poorly designed framework over JDBC that doesn't solve problems, only increases them.
    Above was the only reason i saw, i was using statement instead of preparedstatment as statement was looking easy in this situation.
    please, give me the solution of above using preparedstatment.No, rather you should reconsider your design. What advantage does your insert() method give you over, let's say using a regular PreparedStatement. Granted, you can put your connection opening and other boilerplate code in the method. But if that's your only problem, then your insert method isn't gonna be much use. You could always switch to JPA for example and work with that.

  • How to get the jdbc statement profile in 8.1

    the wls 8.1 api does not have the methods in the wls 7 api for jdbc statement profiling...
    in 7, the connection pool mbean has
    setSqlStmtProfilingEnabled()
    and the connection pool runtime mbean has
    getStatementProfiles(int index, int count)
    but in 8, i don't see these. i see the JDBCStatementProfile object in the api, but i don't see how to enable it or retrieve it.
    is this feature removed? or moved?
    thanks

    Thanks for your response. But I need Process ID
    not Product ID.
    GetCurrentProcessID
    Function should return you Process ID.
    Gaurav Khanna | Microsoft .NET MVP | Microsoft Community Contributor

  • RFC to JDBC JDBC Adapter configuration not initialized: null

    Hi Experts,
    My scenario is Proxy to JDBC scenario. I got this problem when executing the interface I got this problem all of a sudden where previously it was working fine.
    there is no problem with the User id or password.
    com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null
    let me know how to solve this.
    Thanks,
    Prem.

    I got this problem when executing the interface I got this problem all of a sudden where previously it was working fine.
    there is no problem with the User id or password.
    com.sap.aii.af.ra.ms.api.RecoverableException: JDBC Adapter configuration not initialized: null
    Can you ensure that Drivers are properly installed and no problem with them?
    Also proper connection parameters are maintained in the JDBC receiver Channel.
    Regards,
    Abhishek.

  • JDBC Statement Profiling

    Hi,
    I have turned on JDBC Statement Profiling on my server. I can
    get the statements being executed, but the Start & Stop times or
    all Statements is the same. The relevant code and output follows.
    Anybody see what I am doing wrong.
    thanks,
    Harish.
    public static void printJDBCStatement(JDBCStatementProfile mb) {
    System.out.println("\tStatement: " + mb.getStatementText());
    System.out.println("\t\ttime = " + mb.getTimeTaken());
    System.out.println("\t\tstarttime = " + mb.getStartTime());
    System.out.println("\t\tendtime = " + mb.getStopTime());
    System.out.println("\t\tthread = " + mb.getThreadId());
    System.out.println("\t\tParams:");
    int cnt = mb.getParameterCount();
    for(int i=0; i<cnt;i++) {
    System.out.println("\t\t\tParam " + (i+1) + mb.getParameter(i+1));
         Statements:
         Statement: INSERT INTO QUERY (ID, TYPE, OWNER, OBJVERSION) VALUES (?, ?, ?,
    0)
              time = 0
              starttime = 1033591935157
              endtime = 1033591935157
              thread = Thread-15
              Params:
                   Param 132397
                   Param 212650
                   Param 399999999
         Statement: SELECT OBJVERSION FROM QUERY WHERE ID = ? FOR UPDATE NOWAIT
              time = 0
              starttime = 1033591935167
              endtime = 1033591935167
              thread = Thread-15
              Params:
                   Param 132397
         Statement: DELETE FROM SELECT_LIST WHERE QUERY_ID = ?
              time = 0
              starttime = 1033591935177
              endtime = 1033591935177
              thread = Thread-15
              Params:
                   Param 132397
         Statement: SELECT 5, OBJVERSION, 0 FROM QUERY WHERE ID = ?
              time = 0
              starttime = 1033591935187
              endtime = 1033591935187
              thread = Thread-15
              Params:
                   Param 132397

    "Harish" <[email protected]> wrote in message
    news:[email protected]..
    >
    I know for a fact that the statements take more than a 1ms.Could you try to run this code and tell what it prints?
    public class test {
    public static void main(String args[]) throws Throwable {
    long previousTime = 0;
    long currentTime = 0;
    for (int i = 1; i < 1000000; i++) {
    previousTime = System.currentTimeMillis();
    // Thread.sleep(20);
    currentTime = System.currentTimeMillis();
    if (currentTime != previousTime) {
    System.out.println("Difference: " + (currentTime - previousTime));
    Regards,
    SlavaImeshev
    >
    thanks,
    Harish.
    "Slava Imeshev" <[email protected]> wrote:
    Hi Harish,
    AFAIR this fact means that execution time is
    less than 1ms. It's because java timer is not
    very good at measuring precise periods of time.
    So these digits are pretty good :)
    Regards,
    Slava Imeshev
    "Harish" <[email protected]> wrote in message
    news:3d9b6cfd$[email protected]..
    Hi,
    I have turned on JDBC Statement Profiling on my server. I can
    get the statements being executed, but the Start & Stop times or
    all Statements is the same. The relevant code and output follows.
    Anybody see what I am doing wrong.
    thanks,
    Harish.
    public static void printJDBCStatement(JDBCStatementProfile mb){>
    Statements:
    Statement: INSERT INTO QUERY (ID, TYPE, OWNER, OBJVERSION) VALUES
    0)
    time = 0
    starttime = 1033591935157
    endtime = 1033591935157
    thread = Thread-15
    Params:
    Param 132397
    Param 212650
    Param 399999999
    Statement: SELECT OBJVERSION FROM QUERY WHERE ID = ? FOR UPDATE NOWAIT
    time = 0
    starttime = 1033591935167
    endtime = 1033591935167
    thread = Thread-15
    Params:
    Param 132397
    Statement: DELETE FROM SELECT_LIST WHERE QUERY_ID = ?
    time = 0
    starttime = 1033591935177
    endtime = 1033591935177
    thread = Thread-15
    Params:
    Param 132397
    Statement: SELECT 5, OBJVERSION, 0 FROM QUERY WHERE ID = ?
    time = 0
    starttime = 1033591935187
    endtime = 1033591935187
    thread = Thread-15
    Params:
    Param 132397

  • NullPointerException at com.mysql.jdbc.Statement.executeQuery

    hi,
    i use mysql, mm-mysql driver. In code, 4 different types of queries are present i use 4 kind of threads that retrive data from database (for each type of query) every 5 secs.Code sometimes works and sometimes throws null pointer exception.Although i used different result sets for each type of query, problem still remains. what can i do? what is the exact source of problem?
    thanx in advance
    hELin

    GuiSample.java :
    public class ThreadIncoming implements Runnable
    private boolean suspend; // Flag indicating that we should suspend the loop
    private Thread thread;
    public ThreadIncoming()
    start();
    public void start()
    thread = new Thread(this);
    suspend = false;
    thread.start();
    public void suspend()
    // Set the suspend flag - when the run loop comes back round it will check this and wait
    suspend = true;
    public synchronized void resume()
    // Unset the suspend flag - the call to notify will wake up the waiting Thread which will then continue
    suspend = false;
    notify();
    public void stop()
    thread = null;
    resume(); // Call resume in case stop is called while waiting
    public void run()
    if (queryApp != null && queryApp.isConnected() ) {
    while(Thread.currentThread() == thread) {
    if (filterIncomingRuns)
    suspend();
    if(suspend) {
    // Check whether the suspend flag is set - get the current Thread to wait if it is
    synchronized(this)
    while(suspend) {
    try {
    wait();
    catch (Exception e1) {
    e1.printStackTrace();
    try
    fillAlarmTable();
    Thread.sleep(5000);
    catch(InterruptedException e)
    private void fillAlarmTable() {
    queryApp.getTable(logAlarmTable);
    ...//END OF GuiSample.java
    In this class, the thread type used is above shown. Every thread's task is to retrive data from DB and insert it into jtable's in GuiSample.java...
    QueryDB.java: where DB operation are done
    getTable(jtable theTable) {
    stmt = connection.createStatement();
    if (theTable.getModel().getClass().getName().equals("LogAlarmTableModel")) {
    rsAlarm = stmt.executeQuery(sql);
    displayRS(rsAlarm,theTable);
    else if ....
    stmt.close();
    i tried to write some part of the code..waiting for ur advice. thanx
    hELin

  • What is the size limitation of Oracle JDBC Statement?

    Want to know how large is the limiation of one complete SQL insert string can be place
    into a JDBC Statement and can insert the big record successfully. I tried up to 13K, JDBC still can accept it. Does some experienced
    guru can tell me what is the size limitation
    for insert or update SQL string JDBC can accept it?
    Thanks a lot.

    None known. More than 10 GB. Please note Acrobat is not for server use (I mention that because you mention C# and experience shows it is often preferred for backend development).

  • WHAT'S GOING ON!!!? JDBC Statement Problems

    Sorry about the 2 previous posts, I kept getting an error when I tried to submit my thread saying that it could not be posted, but obviously it could!!
    Anyway can anyone help me? One of my JSP's refuses to execute properly so I presume there is something wrong with the associated methods in my connector.java file. Everytime I try and run my JSP in TomCat it produces the error message "java.sql.SQLException: java.sql.SQLException: General error, message from server: "Table 'talboothdb.roomsoccupied' doesn't exist". The MySQL statements I am using work fine when typed directly into MySQL via the Command Prompt so I know they arn't the problem. Can anyone see where I am going wrong?
    The neccessary connector java and the JSP I am using are displayed below,
    package javaclass;
    import java.sql.*;
    import java.util.*;
    public class connector{
      String error;
      Connection con;
      ResultSet rs = null;
      int success;
      public connector()   { }
      public void connect() throws ClassNotFoundException,
                               SQLException,
                               Exception {
           try
                Class.forName("org.gjt.mm.mysql.Driver").newInstance();
                con = DriverManager.getConnection(
                     "jdbc:mysql://localhost:3306/talboothdb","","");
                } catch (ClassNotFoundException cnfe) {
                     error = "ClassNotFoundException: could not locate DB driver";
                     throw new ClassNotFoundException(error);
                } catch (SQLException cnfe) {
                     error = "SQL Exception: Could not connect to database.";
                     throw new SQLException(error);
                } catch (Exception e) {
                     error = "Exception: An unknown error occured while connecting to DB";
                     throw new Exception(error);
           public void disconnect() throws SQLException {
                try {
                     if ( con != null ) {
                          con.close();
                } catch (SQLException sqle) {
                     error = ("SQLException: unable to close the DB connection");
                     throw new SQLException(error);
    public void roomsBooked(String arrivalDate, String departureDate)
                                  throws SQLException, Exception {
                if (con != null) {
                  try {
                    PreparedStatement checkBookings;
                    checkBookings = con.prepareStatement
                         ( "CREATE TEMPORARY TABLE roomsoccupied "
                        + "SELECT roombooked.room_id FROM roombooked, booking "
                        + "WHERE "
                        + "roombooked.booking_id = booking.booking_id "
                        + "AND "
                        + "booking.arrival_date <  '?' "
                        + "AND "
                        + "booking.departure_date >  '?' "
                    checkBookings.setString(1, departureDate);
                    checkBookings.setString(2, arrivalDate);
                    checkBookings.executeUpdate();
                  } catch (SQLException sqle) {
                    error = ""+sqle;
                    throw new SQLException(error);
                } else {
                  error = "Exception: Connection to database was lost.";
                  throw new Exception(error);
         public ResultSet roomsAvailable()
                                  throws SQLException, Exception {
                if (con != null) {
                  try {
                    PreparedStatement checkAvailability;
                    checkAvailability = con.prepareStatement
                         ( "SELECT rooms.room_no FROM rooms "
                        + "LEFT JOIN roomsoccupied ON rooms.room_no=roomsoccupied.room_id "
                        + "WHERE roomsoccupied.room_id IS NULL;"
                    checkAvailability.executeQuery();
                  } catch (SQLException sqle) {
                    error = ""+sqle;
                    throw new SQLException(error);
                } else {
                  error = "Exception: Connection to database was lost.";
                  throw new Exception(error);
             return rs;
    <%@ page language="java"
        import="java.sql.*, java.io.*, java.util.*
         " errorPage="error.jsp" %>
    <jsp:useBean id="javaBean" class="javaclass.connector" />
    <html>
    <head></head>
    <body>
    <%
          javaBean.connect();
          String arrivalDate =  request.getParameter("ArrivalDate");
          String departureDate =  request.getParameter("DepartureDate");
          ResultSet rs = javaBean.roomsAvailable();
          while(rs.next())
          {  %> Room number <%= rs.getString(1) %>
           <P><% }
          javaBean.disconnect();
    %>
    </body>
    </html>

    Cross-posted every which way from Sunday:
    http://forum.java.sun.com/thread.jsp?thread=498755&forum=48&message=2355311
    http://forum.java.sun.com/thread.jsp?thread=498751&forum=54&message=2355294
    http://forum.java.sun.com/thread.jsp?thread=498747&forum=48&message=2355272
    http://forum.java.sun.com/thread.jsp?thread=498746&forum=48&message=2355270
    http://forum.java.sun.com/thread.jsp?thread=497689&forum=54&message=2350463
    bluey_the_punch, why are you so wedded to this CREATE TEMPORARY TABLE? In an earlier thread it was recommended that you see if this can be managed with a JOIN. Did you at least try it?
    I see you added PreparedStatement, but you didn't implement it correctly. You certainly don't need to put single quotes around the question marks in the SQL. I'd also recommend that you make those columns dates in your database and use setDate() to bind the values. Strings compare much differently than dates do. If you're not getting the expected results, that might be why.
    It just looks like you've blown off the advice you've gotten so far and just keep asking the same question in hope of getting the answer you want to hear. JMO - MOD

  • JDBC Adapter throws error for Null Data

    Hi All,
              I am running a interface Proxy to JDBC. But in case if proxy has no new data, the message which goes to the database is:
    <b>  <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:MT_Material xmlns:ns1="urn:sce-com:xi:fi:UnitEstimateData">
    - <Insert_Material>
    - <dbTableName action="INSERT">
      <table>SCEI_UE_MATERIALS</table>
      </dbTableName>
      </Insert_Material>
      </ns1:MT_Material></b>
    and I get the error in RWB as <b>Message processing failed. Cause: com.sap.aii.af.ra.ms.api.RecoverableException: Error processing request in sax parser: Error when executing statement for table/stored proc. 'SCEI_UE_MATERIALS' (structure 'Insert_Material'): java.sql.SQLException: FATAL ERROR document format in structure 'Insert_Material': expected 'access' tag(s) not found</b>.
    Is there a way so that the JDBC adapter doesn't throw any error if there is no access node??
    Pls advice...
    XIer

    Xier,
    Why it will create multiple Insert_Material nodes? Use  like this
    Mandatory segment ->Remove context->Collapse Context ---> Exists -
    >insert_material.
    Try the above and let me know if it doesn't helps!!
    raj.

  • Session State is set to null when tab (from List) is clicked

    Hi Gurus, et al,
    Database: 10g Rel 2
    APEX: 4.1.2
    My application uses a tabbed navigation list to tab through different sections of the form. Each tab issues a doSubmit('tabname');. My application also uses Page 0 for regions that are common to several forms. When I tab through the form (called requisition), the session state for the page items is set to null while the page 0 remains intact. It seems like the doSubmit sets the page items to null. How can I prevent this from happening?
    Also, it still happens on APEX 4.2.1 because I put the application on APEX.ORACLE.COM:
    Workspace: RGWORK
    Application: CSRSR (Application 60220)
    Page: 8
    Username: tester
    Password: test123
    Please follow these steps for this issue to occur
    1. Run application 60220
    2. Select the only choice on the menu (Creative Services Design Requisition (PA 0879))
    3. List of Outstanding Requisitions is displayed
    4. Click the edit icon next to the requisition Project Description is 'zazaza'
    5. Change Date Needed to 3/31/2013
    6. Click on the Project Type tab
    7. All items are null for that tab (project type in the database = 'frame:dec')
    Robert
    http://apexjscss.blogspot.com

    Denes,
    While I appreciate your professional opinion, the issue still remains. I may not have the described the issue clearly. It seems that while the row is initially fetched (source type is only when null), project type and purpose items are not displayed initially with the infomation from the table when the appropriate tab is clicked. For example, while the row contains 'frame:dec' for project type, those checkboxes are checked on on the screen.
    The form is "complex" for the following reasons:
    1. Uses a wizard for new requisitions
    2. Uses tabs for updates
    3. Uses a Modal page to display outstanding requisitions for the user before the form is displayed
    4. Uses common regions (on page 0) with other pages (3 pages uses project information, delivery, requesting department, and chargecode regions.
    5. Authorized approvers popup list are populated
    6. Manual tabular form is used for framing information including collections
    I tried to uses application processes, application computations, package procedures and functions whenever possible.
    SOMEONE, PLEASE HELP!
    Robert
    http://apexjscss.blogspot.com

  • Jdbc statement in case of an unknown database operation

    hi,
    in an application in java, which makes connection to the database using JDBC,
    if for eg, i am not sure if the statement is going to be a select or update or insert, which method of Statement i should be using. ?
    Thanx.

    try execute() method of java.sql.Statement object.
    hi,
    in an application in java, which makes connection to the database using JDBC,
    if for eg, i am not sure if the statement is going to be a select or update or insert, which method of Statement i should be using. ?
    Thanx.

  • Every time I try to view the music tab on iTunes it states an error: new null response. Can someone please help?

    Hi,
    Could someone kindly please help with my iTunes Store error?  When attempting to view the music tab on iTunes store on my iPad 3 states the following error: new null response and cannot connect to iTunes Store.
    It's extremely annoying as I only bought a new album yesterday and its suddenly got an error.  I can use the films and tv programmes tabs which is strange, so its only the music tab not working.  I have tried everything from other websites and blogs but nothing is working for me. 
    I hope someone can help?
    Thanks

    Hello there Mattspur,
    I recommend sections 1, 3, and 5 of the iPad Troubleshooting Assistant found here http://www.apple.com/support/ipad/assistant/ipad/. If you get to section 3 I suggest closing ALL the apps.
    Here is section 1 to get you starrted:
    Restart iPad
    To restart iPad, first turn iPad off by pressing and holding the Sleep/Wake button until a red slider appears. Slide your finger across the slider and iPad will turn off after a few moments.
    Next, turn iPad on by pressing and holding the Sleep/Wake button until the Apple logo appears.
    Is iPad not responding? To reset iPad, press and hold the Sleep/Wake button and the Home button at the same time for at least 10 seconds, until the Apple logo appears.
    If your device does not turn on or displays a red battery icon, try recharging next.
    IF that does not resolve the issue, I would take a look at these articles next.
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    And
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/ts3297
    Regards,
    Sterling

  • I need to supress the printing of a blank page if the total for an AR Statement is 0 or null.

    I have an issue where the XML file for the R03B5001 AR Statement is outputting records with Header information, (name and address), but the total due for the statement is 0.  I have been able to suppress the printing of the header, and detail in my template, but it still generates a single blank page.  How can I suppress the printing of this page?

    Thanks for your answer. Instead of formatting through FireFox, I had to go in and format it via the printer. Duh! Feel stupid not doing this first. If any one else has this problem, I was able to set it up on the printer by going to Printers > Printer Properties > Printer Preferences and set it up. Good luck and thank you for your reply.

Maybe you are looking for

  • Cannot use "declare function" in XMLQuery statement

    Hi All, I'm using Oracle 11g. In a SQL*Plus terminal, if I enter, say: select XMLQUERY(' 1 passing (XMLTYPE('<dummy />')) returning content) from dual; I get, as expected, "1" as an answer. Now, if instead I enter the following code: select XMLQUERY(

  • Cisco ISE NTP MD5 hash is 20-Bytes?

    When attempting to configure an NTP authentication-key in the Cisco ISE CLI I noticed that it will not accept an md5 hash of 32 characters (16 bytes). Instead it is expecting a 40 character (20 bytes) hash. That is in line with a SHA-1 hash, not an M

  • Where is the today folder in favourites?

    where is the today folder in favourites?

  • My iMac Intel 17" stalls at bluescreen after updating Tiger 10.4.6

    After auto upadting my OSX 10.4.6 on my iMac Intel 17" system it is stalling at bluescreen after the Apple symbol and wheel rotation page. Ineed help to come out of it. I have data in my desktop and also in Harddisk. iMac Intel 17"   Mac OS X (10.4.6

  • Screen starting to fail, 2 and a half months old iPhone 5

    Hello, I'm from Brazil and I really don't get many help with my problems around here, so I figured it would be better to post it here, I've bought my iPhone 5 in the USA by december 2012, used it very well, always taking care so that it wouldn't brea