How to return a set of data by using webservice ?
Hi.
I am finding how to return a set of data by using java webservice that serves clients written by others such as VB. Net. Please help me !
Thanks in advance.
Check the how to on Accessing Oracle9iAS Java Web Service from a .NET Client
http://otn.oracle.com/sample_code/tech/java/codesnippet/webservices/index.html
Chandar
Similar Messages
-
How to transfer a set of data from Excel spread sheet to an Access database
hi,
Can any one please tell me how to transfer a set of data from Excel spread sheet to an Access database using SQL query.I'm using java API currently. I have done all sorts of ODBC connection in administrative tools.The file is in correct location. I have done certain coding but with errors.Help me to get rid of these errors,
Coding:*
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection datacon=DriverManager.getConnection("jdbc:odbc:exdata","",""); *//For Excel driver*
Connection datacon1=DriverManager.getConnection("jdbc:odbc:stock1","",""); *// For mdb driver*
Statement datast=datacon.createStatement();
Statement datast1=datacon1.createStatement();
ResultSet excelrs=datast.executeQuery("select item_code,sdata,closing_stock from phy "); *//phy is the excel file*
while(excelrs.next())
String ic=excelrs.getString("item_code");
System.out.println(ic);
String d=excelrs.getString("sdate");
double cs=excelrs.getDouble("closing_stock");
int dbrs=datast1.executeUpdate("insert into second values('"+ic+"','"+d+"',"+cs+")"); *//second is the mdb*
excelrs.close();
}catch(Exception e)
System.out.println(e);
Error:*
java.sql.SQLException: [Microsoft][ODBC Excel Driver] The Microsoft Jet database engine could not find the object 'C:\JavaGreen\phy.xls'. Make sure the object exists and that you spell its name and the path name correctly.
thanks,
kumar.JAVA_GREEN wrote:
No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
The fact that Excel can import a csv file doesn't make it an excel file.
If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that. -
How to generate a set of date type records
How to generate a set of date-type records, with a fixed interval, starting from a date like 2008-01-01.
Some thing like this
SQL> select to_char(to_date('2008-01-01','yyyy-mm-dd') + (level - 1),'DD-MON-YYYY') my_date
2 from dual
3 connect by level <= 10
4 /
MY_DATE
01-JAN-2008
02-JAN-2008
03-JAN-2008
04-JAN-2008
05-JAN-2008
06-JAN-2008
07-JAN-2008
08-JAN-2008
09-JAN-2008
10-JAN-2008
10 rows selected. -
How do I programatically set the date and time of my FP-2000 in LabVIEW RT?
I checked out the following knowledgebase document which has a tool for setting the system time, but I also need to set the date:
http://zone.ni.com/devzone/explprog.nsf/ 6c163603265406328625682a006ed37d/ 37175dbc3696a1ac86256a850051097d?OpenDoc ument
How can I do this?
-JimThat is great, Steven. I also found a solution using GetSystemTime and SetSystemTime which are functions in kernel32.dll that get and set the system date-time. This function call worked on the FP-2000 that I have and should work on RT-Embeded systes, as well.
-Jim
Attachments:
GetSystemTime.vi 16 KB
SetSystemTime.vi 14 KB -
How to return a set of all objects
hi,
i have a simple POJO called Items, for example. In my POJO all I have is two fields, the id and the price of the item which comprise to be two fields in the corresponding table in the database. then i have the getters and setters for these two fields.
i want to have a getItems() method which would essentially return a set of all items. i'm not sure as to how to do this, should there be a loop in the getItems() method which would go through the rows in the table and keep on adding the rows to the set until there are no more rows?
what's the correct way to do this? any ideas, suggestions will be helpful. thanks!!What do you mean "return a set of all items"? You mean all the entries of this type in the DB? Then run query "select * from whatever_that_table_is", iterate over the result set, and and one object to a List for each row. Of course, this is not generally a good approach, as it's quite possible for the number of rows in the DB to exceed what you can hold in memory at one time.
What part are you having trouble with? -
How to return a set of vlaues.
Hello All,
I need to return a set of vlaues from a table.The values will be used by other application.
For example I need all the department names to be retuned . How can we do this. can we return more than one value in a function.
Please let me know the syntax for this.
Kind Regards,
Kumar.I will show you two ways.
1. Using a Table type.
SQL> create or replace type my_dname_type as table of varchar2(14)
2 /
Type created.
SQL> create or replace function my_dname_fn return my_dname_type
2 as
3 ldname my_dname_type;
4 begin
5 select dname bulk collect into ldname from hx_dept;
6 return ldname;
7 end;
8 /
Function created.
SQL> select * from table(my_dname_fn())
2 /
COLUMN_VALUE
ACCOUNTING
RESEARCH
SALES
OPERATIONS2. using a ref cursor
SQL> drop type my_dname_type
2 /
Type dropped.
SQL> drop function my_dname_fn
2 /
Function dropped.
SQL> create or replace function my_dname_fn return sys_refcursor
2 as
3 ldname sys_refcursor;
4 begin
5 open ldname for 'select dname from hx_dept';
6 return ldname;
7 end;
8 /
Function created.
SQL> var ldname refcursor
SQL> exec :ldname := my_dname_fn;
PL/SQL procedure successfully completed.
SQL> print :ldname
DNAME
ACCOUNTING
RESEARCH
SALES
OPERATIONSto know more about this read oracle document.
Thanks,
Karthick. -
Hi !
I have received a set of datas via rs232 and it contains picture messages. I have to decode the datas first and then display them on a canvas.
I have known several functions that may be used . Such as
int SetBitmapData (int bitmapID, int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]);
int CanvasDrawBitmap (int panelHandle, int controlID, int bitmapID, Rect sourceRectangle, Rect destinationRectangle);
However,I don't know how to set the following parameters according to the actual pixel values and color values.
int bytesPerRow, int pixelDepth, int colorTable[], unsigned char bits[], unsigned char mask[]
What's more,I have no idea how to decode the datas.
The attachment is a incomplete project. I will be very appreciated if anyone could help me .
Best regards.
xiepei
I wouldn't care success or failure,for I will only struggle ahead as long as I have been destined to the distance.
Attachments:
Decode and display image.zip 212 KBWell, things are getting a bit clearer now.
1. Your image is actually 240x240 pixel (not 320x240 as you told before). The size of image data is 57600 bytes which corresponds to that frmat (I was puzzled by such a data size compared with larger image dimensions!)
2. The image is a 8-bits-per-pixel one; this means that you must provide a color palette to create the bitmap
3. You cannot simply copy image data into bitmap fields in CVI: CreateBitmap always produce an image with pixeldepth matched with display colour depth (normally 24 or 32 bpp)
All that means that you must:
1. Create the appropriate color palette with 256 colors: it may be a grayscale or color palette depending on camera characteristics. Grayscale palette can be found in my sample project, while sample colour palettes can be found here (here the description of a "standard" 8-bpp color palette)
2. Create the bits array correctly dimensioned for the color depth of your monitor
3. Get each pixel value from the camera, lookup in the color palette for the appropriate colour and create the RGB informations into the bits array in memory
4. Display the bitmap on the canvas
As a first step, I would configure my system for 256-color display setting, create a bitmap and simply copy image data into it: you should be able to get the correct image back to your screen.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos? -
How to reduce the number of data blocks used by table
Hi,
I was trying to reduce the space usage of a particular table of my apex application which stores blob content and therefore deleted many records from it.
However, the data block usage remained the same as before.
I have tried to 'analyze' the table and validate the structure,but am unable to overcome this problem.
Could someone throw some light on what needs to be to reduce the number of data blocks used by this table?
Best Regards,
Priya JetleyPriya:
It is likely that the BLOB content defined in your table is being stored 'Out-of-Line'. This means that the LOB columns are stored in segments of their own. These then are the segments that may need shrinking.
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14249/adlob_tables.htm#i1006363
Varad -
How to count the days between Date Range using OO ABAP?
hi experts,
i want to count the days between Date Range using OO ABAP for that which class and method can i use?.
Thanks,
Mahesh.Not sure I understand the requirement for it to be OO, but you could always write your own (i.e. use this):
REPORT zz_date_diff.
CLASS date_diff DEFINITION.
PUBLIC SECTION.
METHODS diff IMPORTING i_date_fm TYPE d
i_date_to TYPE d
EXPORTING e_days TYPE i.
ENDCLASS."
CLASS date_diff IMPLEMENTATION.
METHOD diff.
e_days = i_date_to - i_date_fm.
ENDMETHOD."
ENDCLASS."
DATA: g_ref TYPE REF TO date_diff,
g_days TYPE i,
g_date_fm TYPE d VALUE '20080101',
g_date_to TYPE d VALUE '20090101'.
START-OF-SELECTION.
CREATE OBJECT g_ref.
CALL METHOD g_ref->diff
EXPORTING
i_date_fm = g_date_fm
i_date_to = g_date_to
IMPORTING
e_days = g_days.
WRITE g_days. -
BI & Oracle XI data exchanges using WEBServices (into both sides)
Hello,
Would you be so kind and give me suggestions.
We have:
<b>BI 7 server Oracle Exchange Infrastructure Oracle DB server</b>
Our client wants to implement this data exchange solution:
<u>Scenario A: i have load data to BI from Oracle DB</u>
My steps are: from <i>BI</i> i have to call WEBService from <i>Oracle Exchange Infrastructure</i> when <i>Oracle Exchange Infrastructure</i> calls WEBService from <i>Oracle DB</i> and <i>Oracle DB</i> returns data set to <i>BI</i> via <i>Oracle Exchange Infrastructure.</i>
How to schedule job for calling WEBServices from <i>Oracle Exchange Infrastructure</i>? What have i configure in <i>BI</i>?
<u>Scenario B: Application based on Oracle DB wants to get data from BI</u>
Steps are: <i>Oracle DB</i> calls WEBService from <i>Oracle Exchange Infrastructure</i> when <i>Oracle Exchange Infrastructure</i> calls WEBService from <i>BI</i> and <i>BI</i> sends data to <i>Oracle DB</i> via <i>Oracle Exchange Infrastructure</i>.
<i>BI</i> offers <i>Open Hub Service</i> for data distribution from <i>BI</i>, but I didnt find description how to distribute data using WEBServices.
Is is possible to implement Scenario A and Scenario B in BI with standard tools.
Could you give me detailed answers(step-by-step what I have to do)?
Thanks in advance.
Best Regards,
Arunas StonysArunas,
Quite an interesting landscape....
Also what do you mean by standard tools ?
Option A :
You can use the XML datasource for the same and once the XML data source is called , the data enters the Delta Queue in the BI server and from there you can use the normal infopackage / real time daemon to load data into your cubes / DSO. The XML datasource works on SOAP and this has to be supported by the Oracle XI.
Option B:
Slightly more trickier since you are hitting the BI server directly....
I am not sure if an infospoke can be a web service but some of the ways this could be done is :
a. Have an Func Module which acts as a web service and have that FM return the data
b. Have SAP XI inbetween to do the same
Also on the landscape- depending on the nature of data loads / data requests - if BI-Oracle is more - you can look at having SAP XI there instead....
Arun
Hope it helps....
P.S I would also suggest that you post the same in the Enterprise SOA forums / enterprise web services and people like Karthik Iyengar , Durairaj etc can respond to the same in a much better way that what I am able to give you right now...
Message was edited by:
Arun Varadarajan -
How to Get and Set personalization data from Iview with Java Webdynpro ?
Hi All,
I'm trying to get Iview properties from an Iview in the portal, did anyone knows how to do this?
sample caode?
Thanks,
AmitYYou can use PCD API to access iView properties
Check this link
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/314ae7a5-0c01-0010-c198-9c7c5e8cee46
/people/daniel.wroblewski/blog/2006/08/15/pcd-ii-creating-portal-objects -
How can I retrieve a LONG data type using ADO
In VB I am using an ADODB object to retrieve data from an Oracle table that has a LONG data type column...
specifically: SELECT TRIGGER_BODY FROM USER_TRIGGERS WHERE TRIGGER_NAME = 'MYTRIGGER'
I have tried using the GETCHUNK method but it only returns the first 150 or so characters no matter how
many times I call it???? here is the sample code I'm using........
Dim Cn As ADODB.Connection, Rs As ADODB.Recordset, SQL As String
Dim sChunk() As Byte
Set Cn = New ADODB.Connection
Set Rs = New ADODB.Recordset
Cn.CursorLocation = adUseServer
Cn.Open "Provider=OraOLEDB.Oracle.1;Password=hrzadmin;Persist Security
Info=True;UserID=hadmin;Data Source=xxx.local"
SQL = "SELECT trigger_body from user_triggers where trigger_name = 'MYTRIGGER'"
Rs.Open SQL, Cn, adOpenStatic, adLockReadOnly
Debug.Print Rs!trigger_name
Debug.Print Rs!trigger_body
sChunk = rs.Fields("trigger_body").GetChunk(500)
Debug.Print sChunkI have a similar code which works for chunk size >400,
The image I am trying to retrieve is huge so the chunksize is also more.
Did you try with any non meta table?
For your reference I am pasting my application code below.
Hope it helps.
--Jagriti
Private Sub cmdGetImage_Click()
Dim bytchunk() As Byte 'variable to store binary data
Dim destinationFileNum As Integer 'variable for filenumber
'recordset for fetching Product Image for the product selected form the list
Dim recProductImage As New ADODB.Recordset
Dim offset As Long
Dim totalsize As Long
Dim roundTrips As Long
'variables used in calculation of time taken to fetch the image
Dim startTime As Currency, EndTime As Currency, time As Currency, Freq As Currency
Dim i As Integer 'counter variable
i = 0
On Error GoTo ErrorText 'redirect to error handler
'** Step 1 **'
'validating if product is selected from the list
If cboSelectProduct.Text = "" Then
MsgBox "Select product from the list!"
Exit Sub
End If
'** Step 2 **'
'validating if "optChunk" optionbox is selected then
'"txtChunksize" textbox should contain a value
If optchunk.Value = True Then
'validate if chunksize value is null
If txtChunkSize.Text = "" Then
MsgBox "Enter value for chunksize "
Exit Sub
End If
'validating that the chunk size entered should be a positive value
If CInt(txtChunkSize.Text) < 1 Then
MsgBox "ChunkSize value should be positive!"
Exit Sub
End If
End If
'** Step 3 **'
'open image column from product_information table using m_Oracon connection
recProductImage.Open "SELECT product_image FROM product_information " & _
" WHERE product_id =" & cboSelectProduct.ItemData(cboSelectProduct.ListIndex) _
, m_Oracon, adOpenStatic _
, adLockOptimistic, adCmdText
'check if product image exists for the product selected
If Not IsNull(recProductImage!product_image) Then
'setting mouse pointer on the form "frmChunkSize" to wait state
frmChunkSize.MousePointer = vbHourglass
'** Step 4 **'
'assigning "desitinationFileNum" variable to next file number
'available for use
destinationFileNum = FreeFile
'allocates a buffer for I/O to the temporary file "tempImage.bmp"
'at the current application path
Open App.Path & "\tempImage.bmp" For Binary As destinationFileNum
'** Step 5 **'
'Get the frequency of internal timer in Freq variable
QueryPerformanceFrequency Freq
'start the timer
QueryPerformanceCounter startTime
'clear "imgProduct" imagebox
imgProduct.Picture = LoadPicture("")
'** Step 6 **
If optValue.Value = True And optchunk.Value = False Then
'** Step 7 **
'using ADO Value property
bytchunk = recProductImage("product_image").Value
'appending byte arrary data to the temporary file
Put destinationFileNum, , bytchunk
'displaying "No. of Round Trips" in a label to 1
lblRoundTrips = 1
ElseIf optchunk.Value = True Then
'** Step 8 **
'converting the value entered "txtChunkSize" textbox to long
'and assigning it to chunksize variable
m_chunksize = CLng(txtChunkSize.Text)
'assigning the actual size of the image retrieved to a variable
totalsize = recProductImage("product_image").ActualSize
'calculating and assigning the "No. of Round Trips" to a variable
roundTrips = totalsize / m_chunksize
'in case fragment of data left, incrementing roundtrips by 1
If (totalsize Mod m_chunksize) > 0 Then
roundTrips = roundTrips + 1
End If
'In this loop the image is retrieved in terms of chunksize
'and appended to the temporary file
Do While offset < totalsize
'** Step 9 **
'retrieving product_image from the recordset, in chunks of bytes
bytchunk = recProductImage("product_image").GetChunk(m_chunksize)
offset = offset + m_chunksize
'appending byte arrary data to the temporary file
Put destinationFileNum, , bytchunk
Loop
'displaying "No. of Round Trips" in a label
lblRoundTrips = roundTrips
End If
'** Step 10 **'
'stop the timer after image retrieval is done
QueryPerformanceCounter EndTime
'close the opened file handle
Close destinationFileNum -
How to find the value of date char used as exception aggregation reference
Hi BI Gurus,
On a BEx report I need to list three things by material:
1) the open (not yet delivered) Purchase Order quantities
2) the PO quantity to be delivered next and
3) the date that belongs to the next delivery
The model supports these data i.e. for each material I can list all open quantities by Purchase Order / Item / Schedule line and the scheduled delivery dates are also available as a characteristic.
Determining 1) is easy as the drilldown is fixed (materials only) the open quantities get summarized for all PO-s belonging to the materials.
To determine 2) I used a Calculated KF simply including KF 1) =Open PO Qty in the definition and setting Exception Aggregation (first value) with a reference char of the delivery date. This gives back the Open PO Quantity to be delivered first.
My question is about how to determine the 3rd value (actually this is not a KPI but a characteristic value). In other words, for each materials I would need to determine the first among all of the possible delivery date char values of the open PO Items / schedule lines. This is the date the quantity shown in the 2nd KPI will be delivered on.
Does anybody have an idea how to approach this issue?
Thanks for you help in advance,
AttilaHi Olivier,
Thanks for your suggestion. I got a bit closer with the replacement path formula variable and the CKF. I tried to apply the same logic of KPI 2) but for some reason it did not work. Actually, it delivers the right value but only when 0SCL_DELDAT (Scheduled delivery date) is in the drilldown But what I need is the first delivery date by Material only, and without this 0SCL_DELDAT drilldown.
Any other ideas?
Thanks and bye,
Attila -
How to find Maximum of a date field using BEx
We are trying to just display the maximum of a date field in a BEx report along with some fixed text .
If we need to create a formula using Maximum function , how to use the same?
For ex, we have a field "Flight Date" in the cube and cube has been updated with flight date till 10.09.2006.
we want to display in the BEx report something like "Flight details are available only till <maximum of the flight date field from the cube>"
Please help.Srilakshmi,
Create a formula on the data and then sort the query on the date , that way the latest date would come on top. I am not sure if you can have something the way you have described..
an option could be :
Have a query on the cube with a condition of top date where the date could be a formula , this way you would get the latest date. se this as a value set to filter another query that displays only the date and nothing else , have some static text beside the query to indicate that this is the latest date.
Hope it helps..
Arun
Assign points if helpful -
How to populate a ComboBox with data from a WebService
I have a simple application that has a DataGrid that gets its
data from a web service. I would prefer to put that data into a
ComboBox instead of a DataGrid. My web service returns objects.
Anyone have any idea how to do that?
<mx:DataGrid id="dgProjects"
dataProvider="{ws.getProjects.lastResult}" >
.....<mx:columns>
..........<mx:DataGridColumn dataField="projectID"
headerText="Project ID" width="100"/>
..........<mx:DataGridColumn headerText="Project Name"
dataField="projectName"/>
..........<mx:DataGridColumn headerText="Doc UNID"
dataField="docUNID" visible="false"/>
.....</mx:columns>
</mx:DataGrid>I tried that but it doesn't work. However, I just found part
of the solution and that was to add labelField="projectName".
That worked. Now, I want to glue together projectID with
projectName and a dash between them. So I changed it to labelField
= "projectID - ProjectName" and that causes the combo box to
display [Object] [object].
Any ideas how to glue those items together?
Maybe you are looking for
-
I receive error messages after installing Illustrator and InDesign
Before today, I spent 3 days downloading the trial programs for Design & Web Premium CS6: Photoshop, Illustrator, InDesign, Audition, Bridge, DreamWeaver, ExtendScript Toolkit, Extension Manager, FireWorks, Media Encoder, Muse, Prelude, Widget Browse
-
Long time to open second or third PDF
Ever since I installed Adobe Reader X it has slowed my system considerably. Opening the first PDF document is no problem, but when I try to open a second of third document it takes around 20 seconds or more to open each doc. The old version instantly
-
How do I add file name in Beta Pages?
I have just upgraded Pages to Beta Pages (version 5.2.2 (1877) on my MacBook Pro and can't find how to add the filename to the footer. The older version gave me the option by clicking on the footer. I can't see that option on the footer or anywhere e
-
Hi, I wanted to know , if i download Photoshop CC and lightroom for 12 dollars a month, and that i'm actually on windows. In 3 months, i'm going to buy an iMac , will i be able to use this Photoshop that i downloaded ? Like do i have to pay 24 dollar
-
I have recently bought the new Macbook Air. I was trying to buy apps in the app store but it keeps coming back that my bank information is wrong when i know that it is right. I have had an iPhone for a couple years now and my app store had always w