Multiple rows in a database
Hi all,
I am sending one single row from one data base to anotherdata base successfully. But I am not able to send multiple rows to another database.I am using parent and child relationship here.
Could anybody help me to solve this problem?
Thanks ,
Gopi.
Hi michal & sunitha,
thanks for ur replies.
Yes in sample mapping it is accepted mulyiple rows.But while executing the scenatio it is saying that run time mapping exception.
This is my source structure :
<?xml version="1.0" encoding="utf-8"?>
<xs:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="resultset">
<xs:complexType>
<xs:sequence>
<xs:element name="row" minOccurs="0" maxOccurs="unbounded"
>
<xs:complexType>
<xs:sequence>
<xs:element name="Id" type="xs:unsignedShort"/>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Account_Id" type="xs:unsignedShort"/>
<xs:element name="Actual_Ship_Date" type="xs:string"/>
<xs:element name="Contact_id" type="xs:unsignedShort"/>
<xs:element name="Due_Date" type="xs:string"/>
<xs:element name="End_Date" type="xs:string"/>
<xs:element name="Item_Product_Id" type="xs:unsignedByte"/>
<xs:element name="Quote_Number" type="xs:unsignedByte"/>
<xs:element name="RequestedShipDate" type="xs:string"/>
<xs:element name="Revision" type="xs:string"/>
<xs:element name="SalesRep" type="xs:string"/>
<xs:element name="Service_Line_Total" type="xs:unsignedByte"/>
<xs:element name="Service_Total" type="xs:unsignedByte"/>
<xs:element name="Bill_to_Contact_Id" type="xs:unsignedByte"/>
<xs:element name="Bill_to_Address_Id" type="xs:unsignedByte"/>
<xs:element name="Ship_To_Contact_Id" type="xs:unsignedByte"/>
<xs:element name="Ship_To_Address_Id" type="xs:unsignedByte"/>
<xs:element name="Start_Date" type="xs:string"/>
<xs:element name="Status" type="xs:string"/>
<xs:element name="Status_Order" type="xs:string"/>
<xs:element name="Status_Type" type="xs:string"/>
<xs:element name="Comment" type="xs:string"/>
<xs:element name="Line_Number" type="xs:unsignedByte"/>
<xs:element name="Part_Number" type="xs:unsignedByte"/>
<xs:element name="Product_Id" type="xs:unsignedByte"/>
<xs:element name="Quantity" type="xs:unsignedByte"/>
<xs:element name="Quantity_Requested" type="xs:string"/>
<xs:element name="Unit_of_Measure" type="xs:string"/>
<xs:element name="SalesDocumentNumber" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
Thanks & Regards ,
Gopi.
Similar Messages
-
FWD: Re: Retrieving multiple rows from a database into morethan
There are two ways to do this that I cn think of right off the bat.
One is to create a class of objects that can receive the entire row, and
give it methods that will return each of the individual objects that you are
looking for when called. If you use INTO :ARRAY, you get the advantage of
being able to pass the array anywhere in your system for the 'split up'
processing.
Two is to do basically the same thing, but instead doing the 'split up'
during a for loop. This will appear to slow down your query, however, as
extra processing will be occuring in terms of memory allocation and copying.
I'm sure there other approaches. This was simply what came to mind at
midnight, after a long day :-).
At 01:33 AM 6/4/96 +0000, you wrote:
Does anyone know of a way to retrieve multiple rows from a single table in an
RDB database into more than 1 object, using a single SQL call?
I have a single table that I wish to use some fields to populate one object
and some others to populate another.
The FOR clause only allows one object to be specified.
The INTO :ARRAY clause also seems to only allow one object to be specified.
I would appreciate any help.
Regads,
Steve Isaac
Hydro Electric Commission
Hobart TAS 7001
Australia
[email protected]
James Urquhart Voice: (510)869-3400
[email protected] Fax: (612)921-8243
Forte Consultingwow, that was pleasant, the usual format goes:
Newb: I have a problem, fix it for me
Forum: Here's a link explaning the concept you obviously don't grasp
Newb: No, fix it FOR me
Forum: I'll fix you!
Newb: WAAAAH!
Forum: BAN! -
Viewing multiple rows in a database.
Hey,
I've been stuck on a problem for a while now. I know that JDBC 1.0 does not allow scrollable resultsets or provide a rowcount method. I know because of this two resultsets are needed,one to get the number of rows and the other to get the values from the rows. Both return the same result set. However when doing this I keep catching an SQL Exception and I dont know why.
The code is in a method in a session EJB but should it not work the same? I shall copy my code in and maybe someone could point out my mistake!
public String[] viewAuctions(TestAuctionVO auctionVO)
// The url for the database
String url = "jdbc:odbc:ProjectDS";
String dbDriver = "sun.jdbc.odbc.JdbcOdbcDriver";
Connection con = null;
Statement stmt = null;
Statement stmt2 = null;
ResultSet rs = null;
ResultSet rs2 = null;
Integer ID = auctionVO.getID();
Integer sellerID = auctionVO.getSellerID();
// Load the driver...
try
con = DriverManager.getConnection(url,"",""); // Create a connection
stmt = con.createStatement();
stmt2 = con.createStatement();
// Build up the SQL statement
String mySQLstmt = ("SELECT * FROM AUCTION WHERE proposedEndDate > GetDate()");
System.out.println("Statement is "+mySQLstmt);
rs = stmt.executeQuery(mySQLstmt);
rs2 = stmt2.executeQuery(mySQLstmt);
System.out.println("Result Set 1 is "+rs);
System.out.println("Result Set 2 is "+rs2);
int numRows = 0;
// While there is another row in the resultset...
while(rs2.next())
// ...another element will be needed in the String array
numRows++;
System.out.println("Number Rows: "+numRows);
// Only perform this section if there is at least one row in theResultSet
if (numRows > 0)
// Set up an array of strings to hold the rows
String[] auctions = new String[numRows];
System.out.println("Number Rows: "+auctions);
// Counter to access the array elements
int i = 0;
System.out.println("i : "+i);
// While there is another row
while(rs.next())
System.out.println("There is another record...");
ID = new Integer(rs.getInt(1));
ID.toString();
System.out.println("\nID = " + ID);
sellerID = new Integer(rs.getInt(2));
sellerID.toString();
System.out.println("Seller ID = "+sellerID);
//...and so on
// Build up the string to store in the array
String userdetails = ID + "," + sellerID + "," ...............
// Put the string in the string array
auctions[i] = userdetails;
// Increment the counter so this element is not overwritten
i++;
// Let User know how many rows were returned
System.out.println("\n Array has : "+auctions.length+" Elements\n");
// For each element in the array
for(int j=0 ; j< numRows; j++)
// If the element is not empty
if(!(auctions[j].equals(null)))
int ElemNum = j+1;
System.out.println(" ViewAuctionEJB viewAuctions method exited");
System.out.println(" Successfull");
System.out.println("Auction Array: "+auctions);
return auctions;
else // If there were no elements in the result set
System.out.println(" ViewAuctionEJB viewAuctions method exited");
System.out.println(" Unsuccessfull: No elements in ResultSet");
stmt.close();
stmt2.close();
con.close();
catch (SQLException sQLE) // There may have been an error in the execution of
{ // the SQL code
System.out.println(" ViewAuctionEJB viewAuctions method exited");
System.out.println(" Unsuccessfull: Error in SQL code");
String[] fail = new String[1] ;
return fail;
String[] success = new String[1] ;
return success;
}Any help is appreciated!
ThanksNot all databases and JDBC drivers support multiple open cursors per connection.
Instead of trying to count rows, define an Auction object. Read Auction objects from the database, and put them in a vector. Return the vector of Auctions (or convert it to an array of Auctions.) If you need a String[] representation, write a function that converts Auction[] to String[] -- nicer separation of duties at least.
That'll be more reliable, too, as the number of rows can't change between the two cursor loops. -
How to insert multiple rows in the database table with the high performance
Hello everybody,
I am using the struts,jsp and spring framework. In my application there are 100s of rows i have to insert into the database 1 by 1. I am using usertransaction all other things are working right but i am not getting the real time performance.
Can anyone tell me the proper method to insert multiple records and also with fast speedI don't know much about Spring etc, but if the jdbc Statemenet.addBatch(), Statement.executeBatch() statements let you bundle a whole lot of sql commands into one lump to execute.
Might help a bit... -
Insert Multiple Rows into a Database
Hi,
I've been working on a project that takes an xml document from JMS queue and inserts the data into db. But the problem here is that there can be any number of data sets. I've been using OEPE for my task, but no matter what I do, the data simply isn't inserted. Could any body please help me? Here is a sample message that I'm trying to insert, as well as the XSDs for the JCA and the input documents.
XSD for JMS Message:
<?xml version="1.0" encoding="windows-1252" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.example.org"
targetNamespace="http://www.example.org"
elementFormDefault="qualified">
<xsd:element name="cannonical">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="orders">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="data" maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rowCode" type="xsd:string"/>
<xsd:element name="productNumber" type="xsd:string"/>
<xsd:element name="attributeType" type="xsd:string"/>
<xsd:element name="attributeCode" type="xsd:string"/>
<xsd:element name="transactionType" type="xsd:string"/>
<xsd:element name="timestamp" type="xsd:dateTime"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
JCA XSD:
<?xml version = '1.0' encoding = 'UTF-8'?>
<xs:schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/top/InsertData" elementFormDefault="qualified" attributeFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="OrderDataCollection" type="OrderDataCollection"/>
<xs:complexType name="OrderDataCollection">
<xs:sequence>
<xs:element name="OrderData" type="OrderData" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OrderData">
<xs:sequence>
<xs:element name="prodnum" type="xs:decimal"/>
<xs:element name="attrtype" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="20"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="attrcode" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="10"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="transtype" minOccurs="0" nillable="true">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="1"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ordertime" type="xs:dateTime" minOccurs="0" nillable="true"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
Sample Input:
<?xml version="1.0" encoding="windows-1252"?>
<ProductData>
<header>
<rowCode>H</rowCode>
<interfaceCode>H6D9J7</interfaceCode>
<createdOn>
<date>
<year>2011</year>
<month>05</month>
<day>23</day>
</date>
<time>
<hour>02</hour>
<minute>05</minute>
<seconds>11</seconds>
</time>
</createdOn>
<description>Front Shop Item Attributes from FMS to JDA PMM</description>
</header>
<body>
<data>
<rowCode>D</rowCode>
<productNumber>0004567</productNumber>
<attributeType>TTTTTT</attributeType>
<attributeCode>CCCCCCCjjj</attributeCode>
<transactionType>A</transactionType>
<timestamp>
<date>
<year>2011</year>
<month>02</month>
<day>19</day>
</date>
<time>
<hour>02</hour>
<minute>05</minute>
<seconds>11</seconds>
</time>
</timestamp>
</data>
<data>
<rowCode>D</rowCode>
<productNumber>0004567</productNumber>
<attributeType>TTTTTT2</attributeType>
<attributeCode>CCCCCCjjj2</attributeCode>
<transactionType>A</transactionType>
<timestamp>
<date>
<year>2011</year>
<month>02</month>
<day>19</day>
</date>
<time>
<hour>02</hour>
<minute>05</minute>
<seconds>11</seconds>
</time>
</timestamp>
</data>
</body>
<footer>
<rowCode>Z</rowCode>
<interfaceCode>H6D9J7</interfaceCode>
<numberOfRows>000000000002</numberOfRows>
</footer>
</ProductData>
I'll be really grateful if anybody can help me out. Thank you.Check below link it may help you out
how to Insert multiple records using single DB Adapter
Thanks
AJ -
Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency
I need to insert multiple rows into a database table using the JDBC adapter (receiver).
I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?Hi Bhavesh/Kanwaljit,
If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
Why i am saying this?
If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
<i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
Doesnt this mean that rows are inserted one by one?
Correct me if i am wrong.
This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
Regards,
Sumit -
(261936172) Q DBC Multiple rows from Database Control method?
Q<DBC> Can you give an example of returning multiple rows from a database?
A<DBC> A Database Control method can return multiple rows.
Assuming the SQL for the method can return multiple rows from
the database, what does the method return? It may return an
Array of Objects*, an Iterator (on a Collection of Objects*)
or a java.sql.ResultSet.
Attached is code that gives an example of returning multiple
rows (not the entire files, but text from them).
* the Objects are either user defined or a HashMap
[rows.txt]hi Keshav,
Earlier i was using same variable SEL in internal table and as a selection column as well. In that case, it was marking SEL as 'X' even when document was selected.
Today, i tried making selection column name as 'MARK' and internal table field name as 'SEL', it is working fine. I am able to read table control lines where MARK equals 'X'.
[http://www.sapdev.co.uk/dialog/tabcontrol/tc_mark.htm]
I followed this link provided by you. Its really useful. Thanks for your help.
Thanks to others as well.
Thanks,
Archana -
Custom database functoid to return multiple rows from database
Hi,
I have created a custom database fucntoid to execute a stored procedure which returns just single row from the database.But I could not manage to return multiple rows from the database.
Does anyone know how to return multiple rows from DB and create a node with that many occurrences in the target schema?
Thanks
JBIf you want to do this in messaging-only way without orchestration, then only option let to you is using .NET in BizTalk:
We had similar requirement with one of our clients, where they didn’t want to use orchestration (though we emphasised on less impact orch would have compared to manageability),
they still wanted to have pure-messaging only.
We extended the custom XslTransform component that ships with BizTalk SDK (<BizTalk installation directory>\SDK\Samples\Pipelines\XslTransformComponent)).
Created a custom disassembler pipeline component, used the XslTransform component from SDK to execute the map’s XSLT. Here we created a map with every links except the database ones. After executing the map, access the database, execute the store procedure
which returns more than one row/dataset, enrich the XSLT transformed message with the dataset from your database in disassembler.
Since .NET gives you the flexibility of access the dataset with more than one row, you can enrich the message in custom pipeline code.
Other option is code the message transformation completely in .NET code in custom disassembler by passing the received message to method/code which would code the map/enrichment.
While enriching you can execute the store procedure which returns more than one row/dataset, enrich the message further with the dataset from db.
If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply. -
How to retreive multiple rows on a tabbed page
Dear Gurus,
I am new to Forms Programming. I have 4 tab pages on the canvas. On one of the tab page I am trying to retrieve multiple rows from the database. I want that the data should be automatically displayed as user changes to that tab page.
The problem which I think is that the cursor is not moving from the first tab page to the new tab page. When I am trying to use go_item, it is not allowing me to change the tab page as all the items on this tab page is display item. Even go_block is not working. I am writing both the functions on When_Tab_Page_Changed trigger.
Please Help!!!!!!!!Hi
Try this one. Check the logic. I didn't have much time to program. With this draft you can begin to do what you need.
Bye, Aron
create or replace package testpkg is
type TYPE_TESTNAMES IS TABLE OF testnames%rowtype index by binary_integer;
procedure getByStatus(countToReturn in NUMBER,status in NUMBER,newStatus in NUMBER, records in out TYPE_TESTNAMES);
end testpkg;
create or replace package body testpkg IS
procedure getByStatus(countToReturn in NUMBER,status in NUMBER,newStatus in NUMBER, records in out TYPE_TESTNAMES)
is
selectedIds MESSAGE_ID_TABLE;
cursor select_messages_by_status (currentStatus NUMBER) is
select id
from testnames
where status= currentStatus
for update;
cursor t (currentStatus NUMBER) is
select *
from testnames
where status= currentStatus
for update;
r testnames%rowtype;
i int := 0;
begin
open select_messages_by_status(status);
fetch select_messages_by_status bulk collect into selectedIds limit countToReturn;
for selectedId in selectedIds.first..selectedIds.last loop
update testnames set status = newStatus where id = selectedId;
end loop;
open t(status);
loop
fetch t into r;
exit when t%notfound;
records(i) := r;
i := i + 1;
end loop;
end getByStatus;
end testpkg;
-- Test program
declare
r testpkg.TYPE_TESTNAMES;
begin
testpkg.getByStatus(2, 0, 3, r);
dbms_output.put_line(r(1).id);
end; -
Hi
I have a JSP page which displays multiple rows from the database. In those two fields are editable and I have a button to save in each row. Since I am running a loop and setting the value in the text field, the name of the text field is same for all the rows. But when I update a row, it always takes the values from the first row. I am using struts ActionForm to get and set the values from JSP. Somewhere i need to say this button corresponds to this row. Can somebody help me on thisSomewhere i need to say
this button corresponds to this row. Can somebody
help me on thismy guess would be to make a counter and increment it as you loop through, and the id for each record could include that number appended to the name/id, do you think that will work for you? -
Multiple Rows Update / Refresh Toplink Query when database trigger involved
Hi everybody!
I have two easy troubles for you; the platform is the same as the SRDemo Toplink version.
1. Multiple Rows Update: I want to update with mergeEntity method, multiple rows for an isolated table; that method receives a parameter that I try to bind with the iterator "dataProvider" but it only merges the first row, not all, any other combination returns an error.
What I want to do is to have a form (like tabular forms in Apex) that lets me update multiple rows in a single page. ¿May anyone tell me how to do it?
2. Refresh Toplink Named Query: I have a list on a page with two columns. From another page, a button does an action that fires a database trigger that updates one of the columns on the list´s page. When I go back to the list, it is not updated; however, the CacheResults´s property is set to false on the iterator.
Thanks in advance,
Alejandro TI didn't use it (yet), but - you might take a look. You'll find a [url http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-plug-ins-182042.html]Timer plug-in on this page. It is a dynamic action which allows you to periodically fire other dynamic actions in the browser. For example use the timer to refresh a region every five minutes. You can perform any dynamic action you want using this infrastructure.So I was thinking: you might use it to run a dynamic action which would check whether something changed in that table (I suppose you'll know the way) (for example, a database trigger might set a flag in some table, timestamp or similar), and - if you find that something really changed - refresh the page.
As I said, I never used it so that's pure theory. Someone else might know better, though. -
How to get multiple rows from database table?
hello !
I need to get multiple rows from a OLEDB database table and display them on a table object.
I did "Wrap in subfrom" on the table, set subform of the table to "flowed", and checked "Repeat row for each data item" of Row1 of the table.
But I can get only one row on the table object.
I need your help.
ThanksHi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
RFC XI JDBC to external database.... Get data in multiple rows
Hi,
We have been really struggling with this scenario. We have created a RFC that has 1 Import parameter (Order_ID) and table parameter (3 Columns: Order_ID, Partner_type, Partner_no).
When we call this RFC in SAP, it should make a connection to external database via JDBC and get multiple row data for every Order_ID. We are not using Oracle Stored Procedure, instead we are using simple Select statement. Did all the mapping and configured correctly. However, we are getting short-dump when we execute RFC. When we checked in XI, it says " Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd at "
Has anyone tried getting multiple row information from external database(Oracle) using Select statement in XI ? IF so, can you pl let us know if we need to something different in Mapping ?
NiranjanNiranjan,
Check this blog of mine to see how the datatype for Synchronous Select should be constructed,
https://weblogs.sdn.sap.com/pub/wlg/3928. [original link is broken] [original link is broken] [original link is broken] [original link is broken]
If this looks good, a few checks
1. Check the request inbound payload , i.e the RFC request in MONI. Is this as expected?
2. Check the output of the request mapping and check if this is as expected.
3. Check the response from JDBC, is this as per the datatype defined.
4. Check the mapping from JDBC response to RFC response.
To me this looks like an issue with the JDBC response structure.
Meanwhile to understand how to test mapping, check blog of michal,
/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios
Regards
Bhavesh -
Problem with database control returning multiple rows as Array using Oracle
Has anybody using Oracle gotten a Database control that
returns multiple rows to work returning an array?
The only way I can seem to return multiple rows is by returning
a RowSet. Returning an array gives me a NullPointerException
(when called within a pageFlow). When calling a database control
that returns an array from a web service I get a
"java.sql.SQLException: ResultSet has no more data." error.
The samples using the pointbase database seem to work, but when I
converted the CustomerDBClient web service to use Oracle, it starts
failing on calling the database control that returns an array
with: "java.sql.SQLException: ResultSet has no more data."
Has anybody gotten this to work using Oracle?
I'm also having some problem returning an Iterator. It seems
to work when called from a web service, but returns nothing
if called from a page flow.
I'm using Oracle 8.1.7 and WebLogic 8.1.
EricDo you need a particular service pack installed to return an array of custom object?
I am getting a ResultSet contained no data error when trying.
Thanks,
-Thomas
"Robin Karlin" <[email protected]> wrote:
>
Eddie O'Neil <[email protected]> wrote:
All--
Unfortunately, returning an Iterator to a JPF (or JSP) from a
database control is broken in WLW 8.1, though it will work inside of
a
JWS or JCS.
There shouldn't be a problem with returning an array of objects out
of Oracle to the JPF, and if you need an Iterator specifically, youcan
wrap the array in an Iterator implementation.
Sorry for the inconvenience.
Eddie
Lenny wrote:
I have gotten it to work on Oracle using Array:)
However, I haven't gotten it to work on Oracle using Iterator:( Itis so
simple, but doesn't work:(
"Eric Dokken" <[email protected]> wrote in message
news:[email protected]...
Has anybody using Oracle gotten a Database control that
returns multiple rows to work returning an array?
The only way I can seem to return multiple rows is by returning
a RowSet. Returning an array gives me a NullPointerException
(when called within a pageFlow). When calling a database control
that returns an array from a web service I get a
"java.sql.SQLException: ResultSet has no more data." error.
The samples using the pointbase database seem to work, but when I
converted the CustomerDBClient web service to use Oracle, it starts
failing on calling the database control that returns an array
with: "java.sql.SQLException: ResultSet has no more data."
Has anybody gotten this to work using Oracle?
I'm also having some problem returning an Iterator. It seems
to work when called from a web service, but returns nothing
if called from a page flow.
I'm using Oracle 8.1.7 and WebLogic 8.1.
Eric
I get the same error that Eric reported when trying to return an Array
of objects.
It is really frustrating because I can't use much of the built-in control
logic
that WLW provides. All I did was create a data pool for Oracle and a
datasource.
I modified the sample app in C:\bea81\weblogic81\samples\workshop\SamplesApp\WebApp\callJavaControl
to point to that datasource and I get the error that Eric reports above.
Can
anyone help me out????
Thanks,
Robin -
Insert multiple rows of records into the database
The codes below allow me to insert a row of record into the database. How would I changed these to insert multiple rows at once? Please help!
String sql = "INSERT INTO EMPLOYEES" +
"(First_Name, Last_Name, Title, Phone) " +
" VALUES " +
PreparedStatement statement = conn.prepareStatement(sql);
statement.setObject (1, First_Name);
statement.setObject (2, Last_Name);
statement.setObject (3, Title);
statement.setObject (4, Phone);
boolean returnValue = statement.execute();Hi mystiqueX,
As wmolosho has suggested in his answer to this very same question that you also posted to the JavaServer Pages forum, you can create a batch of inserts and perform them using the "executeBatch()" method. I will use Craig's sample code to demonstrate:
(Note that this code is untested!)
conn.setAutoCommit(false);
PreparedStatement statement = conn.prepareStatement(sql);
// assume you have an array of objects here
for (int i = 0; i < data.length; i++) {
statement.setString(1, data<i>.getFirstName());
statement.setString(2, data<i>.getLastName());
statement.setString(3, data<i>.getTitle());
statement.setString(4, data<i>.getPhone());
statement.addBatch();
statement.executeBatch();
conn.commit();If you are not familiar with it, allow me to suggest looking at the Making Batch Updates lesson on the Java Tutorial.
Hope it helps.
Good Luck,
Avi.
Maybe you are looking for
-
Win 7 cannot load in boot camp
Hey experts!! Need help... I have successfully installed bootcamp win7 on my mbp 2009 model intel 2nd Gen. I have installed all the programs and it was running great then I wanted my MBP win 7 trackpad to be like mac gesture so I googled and found th
-
I'm losing 2GB of free disk space every day. How can I prevent this?
Every day this week I notice that I lose about 2GB of free disk space on my MacBook Pro. I'm now down to 20GB. When I started the week, I had over 30GB. I haven't installed any new programs of signficance. I store my large documents (photos, music, m
-
Default_css in htmleditorkit
Hy all, I'm developping an html editor and when I load a css file: styles.importStyleSheet(new URL("file:/..mycssfile.css")); htmlKit.setStyleSheet(styles); the loading is ok but after that, i lose the default css file. I guess the solution is note t
-
Unable to stream Channel 4 live
This service is completely unwatcheable. Long pauses and regular message saying 'insufficient bandwidth' According to speedtest.net my connection has 32ms ping and 50M+ download speed. Using Chrome Version 25.0.1364.97 with no addons or ad blockers.
-
Hi, We are using EP 7.0 with CRM 5.0. I have created an ECC based (VD02) transaction Iview. The Iview gets displayed properly on the portal but The problem is that when the user clicks on the F4 for any of the fields, a new blank window pops up wit