How to convert java.sql.ResultSet to intradoc.data.DataResultSet

I used a MS jdbc driver to perform a query and got a java.sql.ResultSet.
Now when I try this

DRS DataResultSet = new DataResultSet();
ResultSet rs = stmt.executeQuery (sqlString);
Drs.Copy ((intradoc. (Data.ResultSet) rs);

I get an error "ClassCastException.
But they compile even without the cast.

I also tried this:

{while (RS. Next())}
trace ("CPC" + rs.getString (1));
String s = rs.getString (1);
Vector v = new Vector < String > < String > ();
v.Add (s);
drs.addRow (v);
}

and I get an error
Caused by: java.lang.Error:! syFailedAppendRow

Is there a way to do it (or something)? Y at - it the javadoc for intradoc.data.DataResultSet?

I'm using eclipse and JRE 1.5
And injectors scanner stellant 10gr 4

Thank you

Published by: kgough on March 2, 2011 06:36

If this does not work, you can always try something like this

public static DataResultSet toDataResultSet(
     final java.sql.ResultSet p_resultset,
     final boolean p_closeAfterCopy
) throws SQLException {

     final ResultSetMetaData rsmd = p_resultset.getMetaData();
     final int columnCount = rsmd.getColumnCount();

     // get headings
     final String[] columnNames = new String[ columnCount ];
     final int[] columnTypes = new int[ columnCount ];
     for ( int i = 0 ; i < columnCount ; i++ ) {
          columnNames[ i ] = rsmd.getColumnName( i + 1 );
          columnTypes[ i ] = rsmd.getColumnType( i + 1 );
     }

     final DataResultSet dataResultSet = new DataResultSet( columnNames );

     while ( p_resultset.next() ) {

          Vector row = new Vector();
          for ( int i = 0 ; i < columnCount ; i++ ) {

               final int fieldType = columnTypes[ i ];

               //if ( fieldType != Types.CHAR || fieldType != Types.VARCHAR ) {
               //     // if you want stuff other than string, do smart stuff here
               //}
               row.add( p_resultset.getString( i + 1 ) );

          }
          dataResultSet.addRow( row );

     }

     if ( p_closeAfterCopy ) {
          p_resultset.close();
     }

     return dataResultSet;

}

Tags: Fusion Middleware

Similar Questions

  • How to convert JAVA. SQL. Date the DATE in the format DD/MM/YYYY to DD/MM/YYYY

    I use an informix database that accepts the value of date as a DATE format...
    the other part of my app takes date from the field in the format DD/MM/YYYY... so I have to convert my java.sql.date in marker AAAA/MM/JJ JJ/MM/AAAA marker of the same type before inserting into db...
    but by using the parse method in SimpleDateFormat class can get the result format java.util.date...
    and also using method format may result in the conversion of strings...

    public class Dbop {
        static final java.text.SimpleDateFormat fmt = new java.text.SimpleDateFormat("dd/MM/yyyy");
        public static void main(String[] args) throws Exception {
            java.util.Date ud = fmt.parse("31/12/2010");
            java.sql.Date sd = new java.sql.Date(ud.getTime());
            String formattedSqlDate = fmt.format(sd);
            System.out.println("result:"+formattedSqlDate);
        }
    }
    
  • How to convert a SQL with variable

    Can Hello, please how I convert the underside with a dominant

    I need to be able to generate a plan to explain it, I think I should use cast.



    SELECT TO_NUMBER (OIL. REBALANCE_ORDER_ID UNIQUE_ID),
    OIL. ORDER_QTY,
    OIL. ORDER_TYPE,
    OIL. ORDER_SIDE,
    OIL. POSITION_TYPE,
    OIL. AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL. GROSS_AMOUNT ORDER_AMT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL. FEE_AMT FEE_AMOUNT,
    OIL. ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    TABLE (: B6) OIL

    >
    I need to be able to generate a plan to explain it, I think I should use cast.

    SELECT TO_NUMBER (OIL. REBALANCE_ORDER_ID UNIQUE_ID),
    OIL. ORDER_QTY,
    OIL. ORDER_TYPE,
    OIL. ORDER_SIDE,
    OIL. POSITION_TYPE,
    OIL. AVAILABLE_QTY AVAILABLE_QUANTITY,
    OIL. GROSS_AMOUNT ORDER_AMT,
    OIL.NET_AMOUNT NET_AMOUNT,
    OIL. FEE_AMT FEE_AMOUNT,
    OIL. ACCRUED_INTEREST_AMT ACCRUED_INTEREST
    TABLE (: B6) OIL
    >
    You're right - mount the bind as the appropriate type. I have a SQL type named emp_table_type so that it works

    explain plan for select * from table(cast (:e1 as emp_table_type))
    

    The models involved are

    CREATE OR REPLACE TYPE SCOTT.emp_scalar_type as object
      (EMPNO NUMBER(4) ,
       ENAME VARCHAR2(10),
       JOB VARCHAR2(9),
       MGR NUMBER(4),
       HIREDATE DATE,
       SAL NUMBER(7, 2),
       COMM NUMBER(7, 2),
       DEPTNO NUMBER(2)
      )
    /
    
    CREATE OR REPLACE TYPE SCOTT.emp_table_type as table of emp_scalar_type
    /
    
  • [Oracle 8i] How to convert a string (timestamp) in a date?

    I find it difficult to know how to convert a string to a date time stamp (or possibly several).

    The timestamp is 20 positions, character (NOT NULL, CHAR (20))
    in the format: YYYYMMDDHHMMSSUUUUUU
    where Y = year, M = month, D = day, M = Minutes, S = seconds and U = microseconds

    The reason why I want to convert it is so that I can compare a timestamp to each other (that is, I want to be able to find the MIN (timestamp), MAX (timestamp) and make comparisons of inequality).

    Is this possible?

    Thanks in advance for the help on this!

    Hello

    As Damorgan said, if all you want to do is find which is the earlier or later, then you can just compare the strings: they are in a format where it works.

    If you need to do other things, such as compare to today date or see the difference between two of your lines of days, you will need to convert it to date. (He has no reason to convert them to numbers).

    A new TIMESTAMP data type, which manages the fractions of a second, was introduced in Oracle 9.
    Since you use Oracle 8 (depending on your subject line), or it must be
    (1) ignores the microseconds, or
    (2) use a separate column for microseconds.

    Whatever it is, use TO_DATE to convert the first 14 characters in DATE:

    TO_DATE ( SUBSTR (txt, 1, 14)
            , 'YYYYMMDDHH24MISS'
            )
    

    where txt is your column of type CHAR.
    To convert microseconds to a number (between 0 and 999999):

    TO_NUMBER (SUBSTR (txt, 15))
    
  • How to convert java ' instanceof' to Labview?

    Dear Sir

    I would use a comparison function that is 'instanceof' in java, but I don't know how to get a similar function in labview OOP (I know normal type, but for the classes that I don't know). In my project, I have 2 classes, one is the parent (Parent) class and the other is the class of the child (child) which extends the class parent. I would like to convert this java code in labview:

    Parent p1 = new Parent();
    if  (child instanceof p1)
    do something;

    Thank you

    mnemo15

    If you want to only check, you can use CFRP, but if you also want to use screws of child1, you need to use TMSC.

  • How to convert MS SQL Server 2008 Stored Procedures of Oracle 11 g SPs?

    We have an application from MS SQL Server 2008. We want to migrate to Oracle 11 g.

    What is the recommended Oracle method for
    (1) migration of data (Tables, triggers, sequences, views etc..)
    (2) the stored Procedure migration.

    What is the recommended tool or method pls?

    We have 100s of MS Sql Server stored procedures. Then, needing a tool or method. We can rewrite all of them from scratch.

    Hello

    Let me clarify some of the issues that you mention. But I advise you to get some professional help with migration because:

    1. you must understand the architectural differences between SQL Server and Oracle. They are of different databases.
    2. understand data type mappings.
    3. understand the complete migration process. Just using the OTN article as a migration guide won't help because it just shows how use SQL Developer to this task.
    4. understand that 100% of successful Oracle conversion is not possible with all the tools. There will always be gaps, gaps in functionality, bugs etc. So there will be some amount of manual work involved.
    5. There are many other tasks involved in the migration that cannot be accomplished with SQL Developer.

    Get now your questions:

    1. in 3.1, there is migration option for the "capture of database in offline mode". It is under the Tools option. So in 3.1 we do not have a separate tab, called "Migration."
    2. use 3.1 because it is much better than 2.1 in terms of capabilities.
    3 migration Wizard is the easiest way to migrate. Where are you getting confused?
    4 "column data" seems to be a stored procedure in SQL Server. If it is not there in the underlying table, why he uses in the SQL statement in the procedure then? I think that we have a problem of "reserved word" with the name of column "Data". Will have to check that.
    5 VARCHAR (@max) must be mapped to VARCHAR2 (4000) in Oracle. It may be a bug in SQL Developer. So during the mapping of data type in the migration wizard, you can change the default mappings.

    Concerning

    Prakash

  • How to convert this SQL PL/SQL query

    Basically, I need to create an anonymous block that will display the name of each student, family name and the number of students who scored less than test 1 that the student.

    So basically you need to find the number of students scoring less than this particular student and we do it for all students of the table.

    So, for this particular query, I designed my code in SQL

    Select g1.gr_fname, g1.gr_lname, count (*)
    grade g1, g2 grade
    where g1.gr_t1 > g2.gr_t1 and
    G1.std_code = g2.std_code
    G1.gr_fname group, g1.gr_lname;

    But I am unable to get the logic of how to run it in PL/SQL, something missing a minor detail to run the same in PL/SQL

    could someone help me please with the logic.

    Thank you

    You can write it in pl/sql like this

    begin
      for i in (
                select g1.gr_fname, g1.gr_lname, count(*) cnt
                  from grade g1,
                       grade g2
                 where g1.gr_t1 > g2.gr_t1
                   and g1.std_code = g2.std_code
                 group by g1.gr_fname, g1.gr_lname;
               )
      loop
        -- I have just wirtern the output into the buffer. You can do what ever you want here.
        dbms_output.put_line(i.gr_fname||'/'||i.gr_lname||'/'||i.cnt);
      end loop;
    end;
    
  • How to convert byte [] EncodedImage rgb565 or bitmap data

    Hi all I am playing a video and I want to get snapshot of video as

    Byte [] byteArr = videoControl.getSnapshot ("encoding = rgb565");

    I try to get the Bitmap as

    image = EncodedImage.createEncodedImage (byteArr, 0, byteArr.length);

    image bitmap = image.getBitmap ();

    but she throws an Exception as IllegalArgumentException.

    I get a table of double length than screenWidth * ScreenHeight, perhaps because of the rgb565

    How can I convert a byte [] bitmap.

    I solve the problem to get the bitmap by building as

    image bitmap = new Bitmap (Bitmap.ROWWISE_16BIT_COLOR, Graphics.getScreenWidth (), Graphics.getScreenHeight (), byteArr);

  • How to convert the analog voltage input form data to True and false (0 = fasle 0: 1-10 = true)

    I want to use for LED or photo

    10 V to ai0 reciece ex to see the LED or photo on front panel

    Help me please

    As part of the comparison, it should look like this.

    Freelance LV cited above, you must provide additional information to get an apt solution

  • checkin_new cause intradoc.data.DataException:! csDbUnableToStartTransaction

    Hi all

    Our requirement is to unzip a file and documentation of all the files and folders individual in Complutense University of MADRID when a zip file is recorded.
    Achieve the same that I work on the development of a java component. I have successfully:
    -Unzip the file and place all of its contents (files and folders) on the UCM backend (I placed the slot/slot/ems2124/oracle/Oracle/Middleware/user_projects/domains/dev_domain/ucm/cs/bin/temp /)
    -Record keeping maintaining their hierarchy structure using service COLLECTION_ADD

    The code is as follows:
    target package;

    Intradoc.data import. *;
    Intradoc.common import. *;
    Intradoc.shared import. *;
    Intradoc.server import. *;

    Import Java.util;
    java.util.zip import. *;
    to import java.util.Enumeration;
    import java. IO;





    / public class UnzipExtract implements FilterImplementor
    {
    final public static String ZIP_ASSOC_FIELD = SharedObjects.getEnvironmentValue ("zipAssociationField");
    public static final char DOS_SEPARATOR = ' \';
    public static final char UNIX_SEPARATOR = ' / ';.
    private static final int BUFF_SIZE = 8192;
    public String extLinkText = "";
    public String extLinkAdd = "";
    public String extLinkDoc = "";




    public int doFilter (ws, DataBinder, ExecutionContext cxt m_binder workspace)
    get DataException, ServiceException
    {

    System.out.println ("* entry filter *");


    String primaryFile = null;
    String extractFlag = null;

    primaryFile = m_binder.getLocal ("primaryFile");
    extractFlag = m_binder.getLocal ("xExtract");

    If (primaryFile! = null & & primaryFile.length () > 0)
    {
    If (primaryFile.endsWith (".zip")) / / & & extractFlag.equals ("Yes"))
    {

    Try
    {

    System.out.println ("* found Zip file *");
    unzipFiles (ws, m_binder, cxt);

    }
    catch (System.Exception e)
    {
    System.out.println (e.getMessage ());
    e.printStackTrace ();
    throw new ServiceException ("Runtime zip checkin error" + e.getMessage (), e);
    }
    }
    }
    Back to CONTINUE;
    }


    protected void unzipFiles (workspace ws, linking DataBinder, ExecutionContext cxt)
    {
    String filename;

    try {}
    /*
    * before we run the new service, we save the old
    the data so as not to pollute the environment.
    */
    DataBinder m_binder = new DataBinder();
    m_binder. Merge (Binder);
    System.out.println ("* new workbook of data *");
    System.out.println (m_binder);

    Properties newData = new Properties ();
    String = m_binder.getLocal ("dID") dId.
    String dDocName = new String();



    System.out.println ("path of the vault construction file");
    String docName = DirectoryLocator.computeVaultFileName (m_binder);
    String vaultFile = m_binder.getLocal ("VaultfilePath");

    System.out.println ("vaultFile" + vaultFile);

    int count = 0;
    String primaryZipName = m_binder.getLocal ("dDocName");
    String originalZipName = m_binder.getLocal ("dOriginalName");

    Unzip the file
    System.out.println ("* decompression file *");
    System.out.println (vaultFile);
    ZipFile primaryZipFile = new ZipFile (vaultFile);
    File myFile = new queue (vaultFile);
    Unzip (myFile, ws, m_binder, cxt);



    }
    catch (Exception e) {}
    System.out.println ("error zipCheckin" + e.getMessage ());
    e.printStackTrace ();

    }

    }





    public void unzip (zip, ws, m_binder DataBinder Workspace, ExecutionContext cxt) survey IOException, FileNotFoundException {}

    System.out.println ("enter unpack");
    String PATH = ' / files/TestComponent ";
    String entityName = null;
    String delimiter = null;
    S service = new service();
    String NomDossierParent = new String ("ShwnayakTest2");
    ParentId a string = new String ('-1');



    try {}
    parentId = getFolderId (ws, parentFolderName);
    s.init (ws, null, m_binder, ServiceData()) new;
    s.initDelegatedObjects ();
    } catch (Exception e) {}
    System.out.println ("error zipCheckin" + e.getMessage ());
    e.printStackTrace ();
    }

    UserData u = new UserData ("sysadmin");
    u.m_attributes = new Hashtable();
    u.m_hasAttributesLoaded = true;
    u.addAttribute ('account', '#all', '15');
    u.addAttribute ("role", "admin", "15");

    s.setUserData (u);


    Understand the separators
    char correctSeparator = File.separatorChar;
    char wrongSeparator;
    If (correctSeparator == DOS_SEPARATOR) {}
    Delimiter = ' \. ';
    wrongSeparator = UNIX_SEPARATOR;
    } else {}
    Delimiter = ' / ';.
    wrongSeparator = DOS_SEPARATOR;
    }

    System.out.println ("delimiter value is:" + delimiter);

    String relativeDir = SharedObjects.getEnvironmentValue ("BinDir");
    If (! relativeDir.endsWith (File.separator)) {}
    relativeDir += File.separator;
    }

    relativeDir += 'temp' + File.separator;

    System.out.println ("value of relativeDir:" + relativeDir);

    FileInputStream input = new FileInputStream (zipFile);
    ZipInputStream zipinputstream = new ZipInputStream (input);

    try {}

    ZipEntry zipentry = zipinputstream.getNextEntry ();

    While (zipentry! = null) {}

    String the EntryName = relativeDir + zipentry.getName ();
    System.out.println ("value of the EntryName:" + nom_entree);
    Translate separators from one platform to the correct platform
    The entryname = entryName.replace (wrongSeparator, correctSeparator);

    Boolean isDirectory = zipentry.isDirectory ();

    Make sure that the directory exists
    String path = new queue (entryName) .getParent ();
    String parentPath = path + File.separator;

    System.out.println ("value of path:" + path);
    New File (path) .mkdirs ();




    String [] dirNames;
    dirNames = entryName.split (delimiter);
    for (int i = 0; i < dirNames.length; i ++) {}
    entityName = dirNames;
    System.out.println (dirNames [i]);
    }

    m_binder.setEnvironment (SharedObjects.getEnvironment ());

    If (! isDirectory) {}
    System.out.println ("It's a file" + entityName);
    FileOutputStream outFile = new FileOutputStream ("entryName");

    try {}
    transferStreams (zipinputstream, outFile);

    System.out.println ("done with the download stream");

    }
    catch (Exception e) {}
    e.printStackTrace ();
    }
    {Finally
    If (outFile! = null) {}
    outFile.close ();
    }
    }



    }
    else {}
    System.out.println ("it is a directory");


    try {}

    To keep the hierarchy, compare the path and relative dir if even its high Ed,.
    otherwise get the folder_name parent of the path, and then click query to get sound collectionid
    and set it as parentcollectionId to this folder

    If (parentPath.equals (relativeDir)) {}
    It comes to upper folder.
    System.out.println ("it comes to upper folder" + entityName);
    } else {}
    This isn't high back, so calculate the parentcollectionId
    System.out.println ("This is not high-back" + entityName);
    dirNames = parentPath.split (delimiter);
    for (int i = 0; i < dirNames.length; i ++) {}
    NomDossierParent = [i] dirNames;
    System.out.println (dirNames [i]);
    }


    System.out.println ("NomDossierParent is" + NomDossierParent);
    parentId = getFolderId (ws, parentFolderName);
    }

    m_binder.putLocal ("IdcService", "COLLECTION_ADD");
    m_binder.putLocal ("hasParentCollectionID", "true");
    m_binder.putLocal ("dCollectionName", EntityName);
    m_binder.putLocal ("dParentCollectionID", ParentId);
    m_binder.putLocal ("dCollectionOwner", "sysadmin");
    m_binder.putLocal ("dDocTitle", EntityName);
    m_binder.putLocal ("dDocName", entityName); This must be unique for each record. Change later
    m_binder.putLocal ("dDocType", "System");
    m_binder.putLocal ("dSecurityGroup", "public");
    m_binder.putLocal ("dDocAuthor", "sysadmin");
    m_binder.putLocal("dCreateDate","");
    executeService (ws, m_binder, "sysadmin", true);

    System.out.println ("folder created successfully");

    resetting the binder to the order of the day
    m_binder.clearResultSets ();
    m_binder.getLocalData (). Clear();



    } catch (Exception e) {}
    e.printStackTrace ();
    }

    }


    zipinputstream.closeEntry ();

    ZipEntry = zipinputstream.getNextEntry ();

    } //while

    System.out.println ("Unzip success");
    } {Finally
    If (zipinputstream! = null) {}
    ZipInputStream.Close ();
    }

    If (ws! = null)
    ws.releaseConnection ();


    }
    }


    public String getFolderId (workspace ws, String NomDossierParent)
    get DataException, ServiceException
    {

    System.out.println ("enter getFolderId");
    String val = new String ('-1');

    String sql = "select dcollectionid from collections +.
    "where dcollectionname = '" + NomDossierParent + "'";
    System.out.println ("request sql is" + sql);

    ResultSet rs = ws.createResultSetSQL (sql);
    if(RS == null) {}
    System.out.println ("result set for getFolderId is empty... problem");
    throw the new ServiceException ("" for getFolderId Resultset is empty... problem "");
    }
    Result DataResultSet = new DataResultSet();
    result. Copy (RS);
    If (result.getNumRows () > = 1) {}
    System.out.println ("result.getNumRows () for getFolderId is greater than 1");
    result. First();
    Val = result.getStringValue (0);
    System.out.println ("dcollectionid is" + val);
    Return val;
    }
    else {}
    System.out.println ("dcollectionid is - 1");
    Return val;
    }
    }


    /**
    Run a service call based on the data in the workbook to help
    * the supplied user credentials
    */
    ' Public Sub executeService (workspace ws, newBinder DataBinder, String userName, boolean)
    suppressServiceError)
    get DataException, ServiceException
    {
    System.out.println ("input run service");


    UserData u = new UserData ("sysadmin");
    u.m_attributes = new Hashtable();
    u.m_hasAttributesLoaded = true;
    u.addAttribute ('account', '#all', '15');
    u.addAttribute ("role", "admin", "15");

    get a connection to the database
    Workspace workspace = ws;
    Look for a value of IdcService
    String cmd = newBinder.getLocal ("IdcService");
    If (cmd is nothing)
    throw new DataException("!csIdcServiceMissing");
    get the service definition
    ServiceData serviceData = ServiceManager.getFullService (cmd);
    If (serviceData is nothing)
    throw new DataException (LocaleUtils.encodeMessage ("!")) csNoServiceDefined", null,
    cmd));
    create the object for this service
    The service = ServiceManager.createService (serviceData.m_classID,
    workspace, null, newBinder, serviceData);
    Get the data from the full user of this user
    service.setUserData (u);
    newBinder.m_environment.put ("REMOTE_USER", username);
    System.out.println ("Done with setup");


    ServiceException error = null;
    Try
    {

    System.out.println ("setSendFlags");
    init service do not return HTML
    service.setSendFlags (true, true);


    System.out.println ("initDelegatedObjects");
    create the ServiceHandlers and producers
    service.initDelegatedObjects ();

    System.out.println ("globalSecurityCheck");
    do a safety check
    service.globalSecurityCheck ();

    System.out.println ("preActions");
    prepare for service
    service.preActions ();

    System.out.println ("shares");
    run the service
    service.doActions ();

    System.out.println ("postActions");
    perform a cleanup
    service.postActions ();
    store new data customization

    service.updateSubjectInformation (true);
    service.updateTopicInformation (newBinder);

    extLinkDoc = newBinder.getLocal ("dDocName");
    extLinkText = newBinder.getLocal ("xLinkTextToDisplay");
    extLinkAdd = newBinder.getLocal ("xLinkWebAddress");

    System.out.println ("done with the performance of service");

    (/ * SystemUtils.trace(AHA_COMPONENT_DEBUG,"dDocName="+newBinder.getLocal("dDocName")\);
    SystemUtils.trace (AHA_COMPONENT_DEBUG, "link
    Text = "+ newBinder.getLocal ("infoLinkText"));"
    SystemUtils.trace (AHA_COMPONENT_DEBUG, "link
    Address = "+ newBinder.getLocal ("infoLinkAdd"));" * /

    }
    catch (ServiceException (e)
    {
    error = e;
    }
    Finally
    {
    Delete all temporary files.
    service.cleanUp (true);

    }
    handle any error
    If (error! = null)
    {
    System.out.println ("errors found");
    If (suppressServiceError)
    {
    System.out.println ("suppressServiceError is true");
    error.printStackTrace ();
    System.out.println (Error.PrintStackTrace ());
    If (newBinder.getLocal ("StatusCode") is nothing)
    {
    System.out.println ("status code is null");
    newBinder.putLocal ("StatusCode", String.valueOf (error.m_errorCode));
    newBinder.putLocal ("StatusMessage", error.getMessage ());
    }
    } else {}
    System.out.println ("suppressServiceError is false");
    throw new ServiceException (error.m_errorCode, error.getMessage ());
    }
    }

    }


    public long transferStreams (in InputStream, OutputStream out)
    throws IOException {}
    ubyte [] buffer = new byte [BUFF_SIZE];
    int iNoOfBytes = - 1;
    long totalBytes = 0;
    While ((iNoOfBytes = in.read (buffer))! = - 1) {}
    out. Write(buffer,0,iNoOfBytes);
    out. Flush();
    totalBytes += iNoOfBytes;
    }
    totalBytes return;
    }

    }




    Now, I want to archive files in the respective folders (i.e. maintaining their hierarchy structure in the zip file).

    Modification of completed code code above are:
    If (! isDirectory) {}
    System.out.println ("It's a file" + entityName);
    FileOutputStream outFile = new FileOutputStream ("entryName");
    try {}
    transferStreams (zipinputstream, outFile);

    System.out.println ("done with the download stream");

    m_binder.putLocal ("IdcService", "CHECKIN_NEW");
    m_binder.putLocal ("dDocTitle", EntityName);
    m_binder.putLocal ("dDocName", entityName); This must be unique for each record. Change later
    m_binder.putLocal ("xCollectionID", ParentId);
    m_binder.putLocal ("dDocType", "Document");
    m_binder.putLocal ("dSecurityGroup", "public");
    m_binder.putLocal ("dDocAuthor", "sysadmin");
    m_binder.putLocal ("primaryFile", entityName);
    m_binder.putLocal ("primaryFile:path", the EntryName);
    System.out.println ("primaryFile:path CHECKIN_NEW with error as real id is" + nom_entree);

    executeService (ws, m_binder, "sysadmin", true);

    System.out.println ("successfully created file");

    resetting the binder to the order of the day
    m_binder.clearResultSets ();
    m_binder.getLocalData (). Clear();

    }
    catch (Exception e) {}
    e.printStackTrace ();
    }
    {Finally
    If (outFile! = null) {}
    outFile.close ();
    }
    }
    } else {}
    ...//existing code logging directory...
    }


    But I can't do the same. I get the below exception while I run the program. No exception for the directory, but when it runs executeService on file (i.e. CHECKIN_NEW) it errors. Same error if I change the name of the service of CHECKIN_UNIVERSAL
    intradoc.common.ServiceException:
    at intradoc.data.WorkspaceTransactionWrapper.beginTransaction(WorkspaceTransactionWrapper.java:62)
    at intradoc.server.ServiceRequestImplementor.beginTransaction(ServiceRequestImplementor.java:347)
    at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1542)
    at intradoc.server.Service.doAction(Service.java:547)
    at intradoc.server.Service.doScriptableAction(Service.java:3964)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at intradoc.common.IdcMethodHolder.invokeMethod(IdcMethodHolder.java:86)
    at intradoc.common.ClassHelperUtils.executeMethodEx(ClassHelperUtils.java:310)
    at intradoc.common.ClassHelperUtils.executeMethod(ClassHelperUtils.java:)
    ....
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
    Caused by: intradoc.data.DataException:! csDbUnableToStartTransaction! csJdbcStartTranWithinATranNotAllowed
    at intradoc.jdbc.JdbcWorkspace.handleSQLException(JdbcWorkspace.java:2546)
    at intradoc.jdbc.JdbcWorkspace.beginTranEx(JdbcWorkspace.java:1137)
    at intradoc.data.WorkspaceTransactionWrapper.beginTransaction(WorkspaceTransactionWrapper.java:57)
    ... more than 117
    Caused by: java.sql.SQLException:! csJdbcStartTranWithinATranNotAllowed
    at intradoc.jdbc.JdbcWorkspace.beginTranEx(JdbcWorkspace.java:1090)
    ... more than 118



    I also tried to create a component with only a single file archiving and even that fails with the same error. Code:

    public int doFilter (ws, DataBinder, ExecutionContext cxt serviceBinder workspace)
    get DataException, ServiceException
    {

    System.out.println ("enter unpack again");
    serviceBinder = new DataBinder();
    serviceBinder.setEnvironment (SharedObjects.getEnvironment ());


    serviceBinder.putLocal ("IdcService", "CHECKIN_NEW");
    serviceBinder.putLocal ("dDocTitle", "ShwnayakTestJune15");
    serviceBinder.putLocal ("dDocType", "Document");
    serviceBinder.putLocal ("dSecurityGroup", "Public");
    serviceBinder.putLocal("primaryFile","/slot/ems2124/oracle/Oracle/Middleware/user_projects/domains/dev_domain/ucm/cs/bin/temp/TestCode/ShwnayakTestJune15.txt");

    executeService (serviceBinder, "sysadmin", true);

    System.out.println ("successfully created file");

    resetting the binder to the order of the day
    serviceBinder.clearResultSets ();
    serviceBinder.getLocalData () .clear ();

    Back to CONTINUE;
    }


    The code in the .hda file:
    <? had version = "7.5.1 (050330) ' jcharset = Cp1252 encoding = iso-8859-1? >
    LocalData @Properties
    version = 2007_02_27 (version 2)
    classpath = $COMPONENT_DIR/classes
    blFieldTypes =
    LIBPATH = $COMPONENT_DIR/lib
    NomComposant = UnzipAndExtract
    hasPreferenceData = false
    blDateFormat = M/d/yy {hh: mm [: ss] [zzz] {aa}}! mAM, MP! tAmerica/Chicago
    @end
    Filters @ResultSet
    4
    type
    location
    parameter
    loadOrder
    postWebfileCreation
    Target.UnzipExtract
    null
    1
    @end
    @ResultSet MergeRules
    4
    Obtained
    toTable
    column
    loadOrder
    @end
    @ResultSet ResourceDefinition
    4
    type
    file name
    tables
    loadOrder
    @end
    @ResultSet ClassAliases
    2
    ClassName
    location
    @end



    I rebooted the WLS (in order to restart the database), but no luck.
    Can someone please help to analyze the cause of this error.

    Thanks in advance,
    Benhamdia

    You don't need to perform the service.cleanUp (true);

    You need to change the filter type of "postWebFileCreation" to "serviceCleanUp".

    Jonathan
    http://redstonecontentsolutions.com
    http://corecontentonly.com

  • How to convert RTF file to the Html tag in java?

    I want to convert Doc to Html tag in java.

    I need this conversion of java code.


    Can you tell me use jar or class?


    DOC/RTF = > CONVERT INTO = > HTML tag


    regads Ninja,

    Published by: Ninja on 1 Sep, 2011 19:12

    Published by: Ninja on 1 Sep 2011 22:03

    A simple google search reveals this: http://www.codeproject.com/Tips/136483/Java-How-to-convert-RTF-into-HTML

  • How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    How to convert the hierarchical query of SQL Server (CTE) to Oracle?

    WITH cte (col1, col2) AS
    (
    SELECT col1, col2
    FROM dbo. [tb1]
    WHERE col1 = 12
    UNION ALL
    SELECT c.col1, c.col2
    FROM dbo. [tb1] AS c INNER JOIN cte AS p ON c.col2 = p.col1
    )
    DELETE one
    FROM dbo. [tb1] AS an INNER JOIN b cte
    ON a.col1 = b.col1

    Hello
    Something like this maybe:

    DELETE FROM dbo.tb1 a
     WHERE EXISTS (
      SELECT 1
        FROM dbo.tb1 b
      WHERE a.co11 = b.col1
          AND a.col2 = b.col2
       START WITH b.col1 = 12
      CONNECT BY b.col2 = PRIOR b.col1)
    

    Although you need to do here is to check that CONNECT it BY SELECT, returns records you wait first, then the DELETION should work too.

  • How to create a dynamic resultset db tree?

    I have a db and sql that includes item_id parent_id, level, description of any hierarchy.

    I want to show this result set on the page as a component of the adf from the tree. How to convert db resultset to adf tree?

    This is my sql - & gt; Display_title, item_id, parent_id, SELECT LEVEL, branch of sac_Hierarchy.Branch(level,description) OF XXXTABLE CONNECT BY job_code = 'ABCD' AND PRIOR item_id = parent_id START WITH job_code is "ABCD" parent_id AND IS NULL;

    What can I do on java support or what I can do on jsp page?

    Help please.

    Thank you

    Published by: Mehmet Ozkan on August 30, 2008 12:19

    Mehmet,

    Have you seen [url http://technology.amis.nl/blog/?p=2116] this?

    John

  • How to convert string to datetime in the transformation of the Ombudsman

    Hello

    I am getting error below when inserting the data in the database using the database.

    Exception occurred when the link was invoked. Exception occurred during invocation of the JCA binding: "JCA binding run reference"insert"operations have to: DBWriteInteractionSpec Execute Failed Exception." insertion failed. The descriptor name: [InsertPayload.XxohInsertStgTable]. Created by Exception [EclipseLink-3001] (Eclipse - 2.3.1.v20111018 persistence Services - r10243): org.eclipse.persistence.exceptions.ConversionException Description of the Exception: object [2015-09-14 15:19:51], class [class java.lang.String], couldn't be converted [class java.sql.Timestamp]. Inner exception: LINK. JCA-11636 couldn't convert Timestamp Exception. Cannot convert a string value in the xml file to a java.sql.Timestamp. Although the databases accept strings representing the timestamps in a variety of formats, the adapter only accepts strings that represent xml ISO dateTime format. The input value must be in the format XS: DateTime to iso 8601, i.e. YYYY-MM - DDTHH:MM:SS.sss - 07:00. Please see the logs

    In the transformation of the mediator, the Source element is a string

    < xs: element name = "CREATED_DATE" type = "xs: String" > < / xs: element >

    Target is of type dateTime

    < xs: element name = "Creation_Date" type = "xs: DateTime" minOccurs = "0" nillable = "true" / >

    To avoid the above error, I used < xsl: value-of select ='xp20:format - dateTime (/CREATED_DATE, "[Y0001]-[M01]-[D01] [H01]: [m01]: [s01]")'/ > in the transformation, but its does not work. The value is blank display after processing.

    Please suggest me how to solve this problem.

    Thank you

    Sunita

    Unfortunately, the format required by the dateTime format is YYYY-MM - DDTHH:MM:SS.sss

    You can use the substring, and on the entry's concat function to create YYYY-MM - DDTHH:MM:SS.sss

    See formatting string to date in BPEL

  • java.sql.SQLException: SQLite.Exception: error in step

    Hello

    Anyone how can I find more information about the sql exception mentioned in the topic of this thread? Battery full below. Here is the code I have in the LifeCycleListenerImpl (application lifecycleListener) that leads to this error:

    =======================================================================================

    115 public void activate()

    {116

    try {117}

    118

    119 string appDir = AdfmfJavaUtilities.getDirectoryPathRoot (AdfmfJavaUtilities.ApplicationDirectory);

    120 files dbFile = new file (appDir + leader. Separator "TEST - DATA.db");

    121 string connStr = "jdbc:sqlite:" + dbFile.getAbsolutePath ();

    122

    123 connection connection = new SQLite.JDBCDataSource (connStr) .getConnection ();

    124 theConnection.setAutoCommit (false);

    125 PreparedStatement stmt = theConnection.prepareStatement ("PRAGMA journal_mode = WAL ;");

    126 stmt.execute ();

    127 stmt = theConnection.prepareStatement ("PRAGMA temp_store = MEMORY ;");

    128 stmt.execute ();

    129

    130 / / theConnection.commit ();

    131

    132.}

    133 catch (Exception e) {}

    134 System.out.println ("* enable Exception *");

    135 e.printStackTrace ();

    136 System.out.println ("* enable Exception *");

    137}

    138}

    =======================================================================================

    java.sql.SQLException: SQLite.Exception: error in step

    at SQLite.JDBC2z1.JDBCStatement.executeQuery (unknown Source)

    at SQLite.JDBC2z1.JDBCPreparedStatement.execute (unknown Source)

    on-demand. LifeCycleListenerImpl.activate (LifeCycleListenerImpl.java:125)

    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke (unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke (unknown Source)

    at java.lang.reflect.Method.invoke (unknown Source)

    at oracle.adfmf.util.BasicStateModel.executeLifecycleListeners (unknown Source)

    at oracle.adfmf.util.BasicStateModel.transition (unknown Source)

    at oracle.adfmf.util.BasicStateModel.transition (unknown Source)

    at oracle.adfmf.framework.FeatureContextManager.activate (unknown Source)

    at oracle.adfmf.framework.JavaFramework.main (unknown Source)

    Caused by: SQLite.Exception: error in step

    at SQLite.Vm.step (Native Method)

    at SQLite.Database.get_table (unknown Source)

    ... 12 more

    =======================================================================================

    Kind regards

    Majdi Jaqaman

    Hello

    OK, it's ridiculous, but just after I posted the message, I looked at the code for a few seconds and then I thought let me comment the 'theConnection.setAutoCommit (false); line and it seems that this was the cause of the error.

    So I know that the solution to the problem, but someone who is a guru of sqlite and know how to investigate problems of sqlite like this is allowed to share his ideas basically, I would like to know if there is a systematic approach for debugging of problems where the sql exception does not provide much information.

    Kind regards

    Majdi Jaqaman

Maybe you are looking for