Using a string source to create a filestream
is there any way 2 use a string source to create a filestream.
eg string s= " JAVA ";
now i want a filestream containg this string s.
You could save the string to a file and then open it. However, that seems a stupid thing to need to do. Why do you need a FileStream rather than an InputStream?
Similar Messages
-
Using a string variable to create an object
Hi, I just have a quick question. It is probably very simple but I can not seem to find an asnwer anywhere.
I have a class called Receive, from this class I derrive 12 difference other classes.
I also have a hashtable with a bunch of Object objects. At run time I get one of these objects according to some hastable key. So once I have this object I need to cast it to the right type (one of the above mentioned 12).
So I know I can find out which type this object is by doing this: object.getClass()
This returns a Class object. I then need to somehow use this class object to perform the cast. I tried everything and it doesnt seem to work. Then I thought well I can get the string name of the class : object.getClass().getName()
So I'm wandering if there is a way to use this string to cast my object. Or maybe there is another way.
I did see the cast() method in the Class api but I can't figure out the point of it since is returns an Object class object and not my class's object.I took your advice and re factored the Receive class so it had all the functionality I needed except two methods which would then be overridden in the derived classes. What I had a hard time understanding is once an object of class say SpecialReceive extends Receive it can be referred to as Receive yet still maintain that it's a SpecialReceive.
What I mean is if I give a Receive object to some method and this method has no idea that this object is actually SpecialReceive and it calls a method say run() which gets overridden by the SpecialReceive. I thought that since this method has no idea what type of Receive this object is it will execute Receive's run(). But it actually does know what type of class it is and it executes the right run() method (the one that SpecialReceive overrides).
After I realized this there is no more need for casting.
Thanks everyone for your contributions. -
Function that returns N values, without using a string
Hi, how can i make a function that returns several valures (that hasn't a exact number of returned values, it could return 3 values, or 7) without using a string?
When i need to return several values from a function, i put the values inside a varchar like thus 'XXX,YYY,ZZZ' and so on. Don't know if this has a poor performance.
If you can supply simple examples for what im asking, i would be nice.
(without using a string)Can i create the type objects inside a package? If i
can, they will be local to the package, right?Yes, you're right.
Pipeline returns a row or several?You can use pipelined function in the same way you use table:
SELECT * FROM TABLE(pipelined_funct(agr1, agr2));
It returns results as separate rows. -
How to create a report using XML data source from Crystal Report Designer
Hi,
Iu2019m having Crystal Report Designer XI R2 SP4. Iu2019m trying to create a report using XML data source stored on disk. This is a customer order report and the xml is structured in such a way that it has an order details header part (master) and then it has several order lines (detail). One order line can have several order line characteristics (detail-detail). So what I need to know is now I can design this layout from the designer. If this was done using views I can do it with sub-reports but using xml data this seems to be different. Can you help me to design this layout? I have included the xml and xsd as well.
Thank you in advance.
Regards,
Chanaka
XML
<?xml version="1.0" encoding="UTF-8"?>
<CUSTOMER_ORDER_CONF_REP_REQUEST xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns="urn:ifsworld-com:customer_order_conf_rep">
<CUSTOMER_ORDER_CONF_REP>
<ORDER_NO>D555809</ORDER_NO>
<PRINTED_DATE>2009-03-26T08:52:54</PRINTED_DATE>
<AUTHORIZE_NAME>Chanaka</AUTHORIZE_NAME>
<CUSTOMER_NO>CU-1473-INV</CUSTOMER_NO>
<CUST_NAME>Mr.Johan Matts</CUST_NAME>
<SHIP_ADDR_1>93,Main Street</SHIP_ADDR_1>
<SHIP_ADDR_2>Negambo Road</SHIP_ADDR_2>
<SHIP_ADDR_3>Watthala</SHIP_ADDR_3>
<SHIP_ADDR_4>SRI LANKA</SHIP_ADDR_4>
<BILL_ADDR_1>93,Main Street</BILL_ADDR_1>
<BILL_ADDR_2>Negambo Road</BILL_ADDR_2>
<BILL_ADDR_3>Watthala</BILL_ADDR_3>
<BILL_ADDR_4>SRI LANKA</BILL_ADDR_4>
<CUSTOMER_PO_NO>112984638</CUSTOMER_PO_NO>
<CUSTOMER_FAX>112984639</CUSTOMER_FAX>
<CUSTOMER_EMAIL>abcbababab</CUSTOMER_EMAIL>
<ORDER_LINES>
<ORDER_LINE>
<LINE_NO>1</LINE_NO>
<CUSTOMER_PART_NO>NW-IP11</CUSTOMER_PART_NO>
<CUSTOMER_PART_DESC>iPod</CUSTOMER_PART_DESC>
<SALE_UNIT_PRICE>1200</SALE_UNIT_PRICE>
<PRICE_TOTAL>1200</PRICE_TOTAL>
<DISCOUNT>0</DISCOUNT>
<PRICE_QTY>1</PRICE_QTY>
<ORDER_LINE_CHARACTERSTICS>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID xsi:nil="1"/>
<CHARACTERISTIC_VALUE xsi:nil="1"/>
</CHARACTERISTIC_ITEM>
</ORDER_LINE_CHARACTERSTICS>
</ORDER_LINE>
<ORDER_LINE>
<LINE_NO>2</LINE_NO>
<CUSTOMER_PART_NO>NW-IP24</CUSTOMER_PART_NO>
<CUSTOMER_PART_DESC>XGA Projector</CUSTOMER_PART_DESC>
<SALE_UNIT_PRICE>500</SALE_UNIT_PRICE>
<PRICE_TOTAL>1500</PRICE_TOTAL>
<DISCOUNT>0</DISCOUNT>
<PRICE_QTY>3</PRICE_QTY>
<ORDER_LINE_CHARACTERSTICS>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>Free Instalation</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
</ORDER_LINE_CHARACTERSTICS>
</ORDER_LINE>
<ORDER_LINE>
<LINE_NO>3</LINE_NO>
<CUSTOMER_PART_NO>NW-IP02</CUSTOMER_PART_NO>
<CUSTOMER_PART_DESC>Sony DVD Player</CUSTOMER_PART_DESC>
<SALE_UNIT_PRICE>1000</SALE_UNIT_PRICE>
<PRICE_TOTAL>1000</PRICE_TOTAL>
<DISCOUNT>0</DISCOUNT>
<PRICE_QTY>1</PRICE_QTY>
<ORDER_LINE_CHARACTERSTICS>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>Free 5 DVDs</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
</ORDER_LINE_CHARACTERSTICS>
</ORDER_LINE>
<ORDER_LINE>
<LINE_NO>4</LINE_NO>
<CUSTOMER_PART_NO>NW-IP99</CUSTOMER_PART_NO>
<CUSTOMER_PART_DESC>Flatscreen TV</CUSTOMER_PART_DESC>
<SALE_UNIT_PRICE>1500</SALE_UNIT_PRICE>
<PRICE_TOTAL>1350</PRICE_TOTAL>
<DISCOUNT>10</DISCOUNT>
<PRICE_QTY>1</PRICE_QTY>
<ORDER_LINE_CHARACTERSTICS>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>Free Delivery</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>2</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>1 year additional warranty</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
</ORDER_LINE_CHARACTERSTICS>
</ORDER_LINE>
<ORDER_LINE>
<LINE_NO>5</LINE_NO>
<CUSTOMER_PART_NO>NW-IP56</CUSTOMER_PART_NO>
<CUSTOMER_PART_DESC>Sony MP3 Player</CUSTOMER_PART_DESC>
<SALE_UNIT_PRICE>200</SALE_UNIT_PRICE>
<PRICE_TOTAL>400</PRICE_TOTAL>
<DISCOUNT>0</DISCOUNT>
<PRICE_QTY>2</PRICE_QTY>
<ORDER_LINE_CHARACTERSTICS>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>1</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>Free carry belt</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>2</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>Free promotional 4GB memory bar</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ITEM>
<CHARACTERISTIC_ID>3</CHARACTERISTIC_ID>
<CHARACTERISTIC_VALUE>No warranty on memory bar</CHARACTERISTIC_VALUE>
</CHARACTERISTIC_ITEM>
</ORDER_LINE_CHARACTERSTICS>
</ORDER_LINE>
</ORDER_LINES>
</CUSTOMER_ORDER_CONF_REP>
</CUSTOMER_ORDER_CONF_REP_REQUEST>
XSD
<?xml version="1.0" encoding="UTF-8"?>
<?report module="ORDER" package="CUSTOMER_ORDER_CONF_REP" ?>
<xs:schema targetNamespace="urn:ifsworld-com:customer_order_conf_rep" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="urn:ifsworld-com:customer_order_conf_rep" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="CUSTOMER_ORDER_CONF_REP_REQUEST">
<xs:complexType>
<xs:all minOccurs="1" maxOccurs="1">
<xs:element name="CUSTOMER_ORDER_CONF_REP">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="50">
<xs:element name="ORDER_NO" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PRINTED_DATE" type="xs:dateTime" nillable="true" minOccurs="0"/>
<xs:element name="AUTHORIZE_NAME" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUSTOMER_NO" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUSTOMER_PO_NO" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUST_NAME" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SHIP_ADDR_1" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SHIP_ADDR_2" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SHIP_ADDR_3" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SHIP_ADDR_4" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BILL_ADDR_1" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BILL_ADDR_2" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BILL_ADDR_3" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="BILL_ADDR_4" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUSTOMER_FAX" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUSTOMER_EMAIL" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ORDER_LINES" nillable="true" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="ORDER_LINE">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="39">
<xs:element name="LINE_NO" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="SALE_UNIT_PRICE" type="xs:float" nillable="true" minOccurs="0"/>
<xs:element name="PRICE_TOTAL" type="xs:float" nillable="true" minOccurs="0"/>
<xs:element name="DISCOUNT" type="xs:float" nillable="true" minOccurs="0"/>
<xs:element name="PRICE_QTY" type="xs:float" nillable="true" minOccurs="0"/>
<xs:element name="CUSTOMER_PART_NO" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="4000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CUSTOMER_PART_DESC" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="4000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ORDER_LINE_CHARACTERSTICS" nillable="true" minOccurs="0">
<xs:complexType>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="CHARACTERISTIC_ITEM">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="6">
<xs:element name="CHARACTERISTIC_ID" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CHARACTERISTIC_VALUE" nillable="true" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="2000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:choice>
</xs:complexType>
</xs:element>
</xs:all>
</xs:complexType>
</xs:element>
</xs:schema>Hi Sourashree,
Thank you for the response and ideas you have given me so far. I can get the fetch the data from the data source without any problem. That is I do the following,
1. New Report
2. From Create New Connection-> XML
3. Provide the u201CLocal XML Fileu201D and have u201CSpecify Schema Fileu201D checked -> Next
4. Provide the u201CLocal Schema Fileu201D -> Finish
Then I can see the following under XML
+ CUSTOMER_ORDER_CONF_REP_REQUEST
CUSTOMER_ORDER_CONF_REP_REQUEST
CUSTOMER_ORDER_CONF_REP_REQUEST/CUSTOMER_ORDER_CONF_REP
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS/CHARACTERSTIC_ITEM
And from here if I add the following three I can get all the fields I need to the report
CUSTOMER_ORDER_CONF_REP_REQUEST/CUSTOMER_ORDER_CONF_REP
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE
CUSTOMER_ORDER_CONF_REP_REQUEST/ CUSTOMER_ORDER_CONF_REP/ORDER_LINES/ORDER_LINE/ORDER_LINE_CHARACTERSTICS/CHARACTERSTIC_ITEM
Then I come to the Linking section. Here I canu2019t link anything. There is a common field called u201CInternal_IDu201D but I canu2019t link using it. So I get a message when I click Next. From here I add all the fields.
For this point onwards only I need help. How do I group, add fields and design the layout so I can get an report output as follows.
Date
Order number Authorized code
Customer No
Name
Phone
Fax email
Shipping address 1 Billing Address 1
Shipping address 2 Billing Address 2
Shipping address 3 Billing Address 3
Shipping address 4 Billing Address 4
Order Line 1 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026 LINE_NO CUSTOMER_PART_NO CUSTOMER_PART_DESC SALE_UNIT_PRICE PRICE_QTY DISCOUNT PRICE_TOTAL
Characteristic details belonging to Order line 1 CHARACTERISTIC_ID 1 CHARACTERISTIC_VALUE1
CHARACTERISTIC_ID 2 CHARACTERISTIC_VALUE2
CHARACTERISTIC_ID 3 CHARACTERISTIC_VALUE3
Order Line 2 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
Characteristic details belonging to Order line 2
Order Line 3 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
Characteristic details belonging to Order line 3
Order Line 4 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
Characteristic details belonging to Order line 4
Order Line 5 detailsu2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026u2026
Characteristic details belonging to Order line 5
How can I achieve this kind of a layout using the give xml and xsd? Should I use grouping if so how should I do the grouping?
I have included the full xml and xsd in the first mail I posted but I canu2019t see it now. I can include that again if you want.
Regards,
Chanaka -
Reading & writing to file using ArrayList String incorrectly (2)
I have been able to store two strings (M44110|T33010, M92603|T10350) using ArrayList<String>, which represent the result of some patient tests. Nevertheless, the order of these results have been stored correctly.
E.g. currently stored in file Snomed-Codes as -
[M44110|T33010, M92603|T10350][M44110|T33010, M92603|T10350]
Should be stored and printed out as -
M44110|T33010
M92603|T10350
Below is the detail of the source code of this program:
import java.io.*;
import java.io.IOException;
import java.lang.String;
import java.util.regex.*;
import java.util.ArrayList;
public class FindSnomedCode {
static ArrayList<String> allRecords = new ArrayList<String>();
static public ArrayList<String> getContents(File existingFile) {
StringBuffer contents = new StringBuffer();
BufferedReader input = null;
int line_number = 0;
int number_of_records = 0;
String snomedCodes = null;
ArrayList<String> complete_records = new ArrayList<String>();
try {
input = new BufferedReader( new FileReader(existingFile) );
String current_line = null;
while (( current_line = input.readLine()) != null) {
// Create a pattern to match for the "\"
Pattern p = Pattern.compile("\\\\");
// Create a matcher with an input string
Matcher m = p.matcher(current_line);
boolean beginning_of_record = m.find();
if (beginning_of_record) {
line_number = 0;
number_of_records++;
} else {
line_number++;
if ( (line_number == 2) && (current_line.length() != 0) ) {
snomedCodes = current_line;
System.out.println(snomedCodes);
complete_records.add(current_line);
catch (FileNotFoundException ex) {
ex.printStackTrace();
catch (IOException ex){
ex.printStackTrace();
finally {
try {
if (input!= null) {
input.close();
catch (IOException ex) {
ex.printStackTrace();
return complete_records;
static public void setContents(File reformatFile, ArrayList<String> snomedCodes)
throws FileNotFoundException, IOException {
Writer output = null;
try {
output = new BufferedWriter( new FileWriter(reformatFile) );
for (String index : snomedCodes) {
output.write( snomedCodes.toString() );
finally {
if (output != null) output.close();
static public void printContents(File existingFile) {
StringBuffer contents = new StringBuffer();
BufferedReader input = null;
int line_number = 0;
int number_of_records = 0;
String snomedCodes = null;
try {
input = new BufferedReader( new FileReader(existingFile) );
String current_line = null;
while (( current_line = input.readLine()) != null)
System.out.println(current_line);
catch (FileNotFoundException ex) {
ex.printStackTrace();
catch (IOException ex){
ex.printStackTrace();
finally {
try {
if (input!= null) {
input.close();
catch (IOException ex) {
ex.printStackTrace();
public static void main (String args[]) throws IOException {
File currentFile = new File("D:\\dummy_patient.txt");
allRecords = getContents(currentFile);
File snomedFile = new File( "D:\\Snomed-Codes.txt");
setContents(snomedFile, allRecords);
printContents(snomedFile);
}There are 4 patient records in the dummy_patient.txt file but only the 1st (M44110|T33010) & 3rd (M92603|T10350) records have results in them. The 2nd & 4th records have blank results.
Lastly, could someone explain to me the difference between java.util.List & java.util.ArrayList?
I am running Netbeans 5.0, jdk1.5.0_09 on Windows XP, SP2.
Many thanks,
Netbeans Fan.while (snomedCodes.iterator().hasNext())
output.write( snomedCodes.toString() );
}Here you have some kind of a list or something (I couldn't stand to read all that unformatted code but I suppose you can find out). It has an iterator which gives you the entries of the list one at a time. You keep asking if it has more entries -- which it does -- but you never get those entries by calling the next() method, so it always has all the entries still available.
And your code inside the loop is independent of the iterator, so it's rather pointless to iterate over the entries and output exactly the same data for each entry. Even if you were iterating correctly. -
What is difference between using interface as source and table as source?
I am working on a batch flow which need several steps to populate data from source to target. For example, I need 5 interfaces to finish final data loading. I can either use interface or use temporary table as source and target for the interface 2, 3, and 4. It looks like both case will use tables no matter use interface or use temporary table. So my question is if there is any difference between these two (using interface as source or use temporary table as source)?
Thanksif you use a Table as source for the intermediate process, it will create a physical temporary table i your work rep(depends on you choice) and populate the data into the table. if you use a interface as a source, just it will create a sub query instead of temporary table.
Thanks
nidhi -
Hi,
When trying with Postman sending a REST call to Azure Storage Queues I get:
The MAC signature found in the HTTP request '***' is not the same as any computed signature. Server used following string to sign: 'POST.
The code I have for creating the Authorization Header:
var accountName = "my_account";
string key = ConfigurationManager.AppSettings["my_access_key"];
DateTime dt = DateTime.Now;
string formattedDate = String.Format("{0:r}", dt);
var canonicalizedHeaders = "x-ms-date:" + formattedDate + "\n" + "x-ms-version:2009-09-19" + "\n" ;
var canonicalizedResource = "/my_account/myqueue/messages";
var stringToSign = String.Format("POST,\n\n\n\n\n\n\n\n\n\n\n{0}{1}", canonicalizedHeaders, canonicalizedResource);
stringToSign = HttpUtility.UrlEncode(stringToSign);
HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(key));
var signature = Convert.ToBase64String(hmac.ComputeHash(Encoding.UTF8.GetBytes(stringToSign)));
var authorizationHeader = String.Format(CultureInfo.InvariantCulture, "SharedKey {0}:{1}", accountName, signature);
return authorizationHeader;
Anyone any idea what I'm missing/doing wrong?
Additional question: do i have to create for every message I want to send a new Authorization header? Or is there an option (as with Service Bus Topics) to create a header that can be used for a certain timeframe?
Thanks.One issue is with this line of code:
HMACSHA256 hmac = new HMACSHA256(Encoding.UTF8.GetBytes(key));
Please use the following:
HMACSHA256 hmac = new HMACSHA256(Convert.FromBase64String(key));
and that should take care of the problem.
Regarding your question, "do i have to create for every message I want to send a new Authorization header? Or is there an option (as with Service Bus Topics) to create a header that can be used for a certain timeframe?"
With your current approach, the answer is yes. What you can do is create a Shared Access Signature on the queue which will be valid for certain duration and then use that for posting messages to a queue using simple HttpWebRequest/HttpWebResponse.
Hope this helps. -
How to use List String in JSP page?
Hello All,
I am having problem using List<String> in my JSP page. Below is my JSP code.
<%@ page import="java.util.*, java.io.*"%>
<html>
<body>
<h1 align="center">Beer Recommendations JSP</h1>
<p>
<%
List<String> beerBrands = (List<String>)request.getAttribute("styles");
Iterator<String> it = beerBrands.iterator();
while(it.hasNext()){
out.print("<br>try: " + it.next());
%>
</body>
</html>
When I compile the above JSP code in Eclipse 3.4 (using JBoss 4.2 as my Application Server), I get the following Warning.
Type safety: Unchecked cast from Enumeration to Enumeration<String>
If I add the "@SuppressWarnings("unchecked")" to the code, Eclipse does not give any Error during compilation. But, at runtime, I get the following Error.
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 10 in the jsp file: /BeerAdvice.jsp
Syntax error, annotations are only available if source level is 5.0
7: <p>
8:
9: <%
10: @SuppressWarnings("unchecked")
11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
12: Iterator<String> it = beerBrands.iterator();
13: while(it.hasNext()){
An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
The type List is not generic; it cannot be parameterized with arguments <String>
8:
9: <%
10: @SuppressWarnings("unchecked")
11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
12: Iterator<String> it = beerBrands.iterator();
13: while(it.hasNext()){
14: out.print("<br>try: " + it.next());
An error occurred at line: 11 in the jsp file: /BeerAdvice.jsp
Syntax error, parameterized types are only available if source level is 5.0
8:
9: <%
10: @SuppressWarnings("unchecked")
11: List<String> beerBrands = (List<String>)request.getAttribute("styles");
12: Iterator<String> it = beerBrands.iterator();
13: while(it.hasNext()){
14: out.print("<br>try: " + it.next());
Any help is very much appreciated.
Thank you for your help.
Thanks,
ChubhaHi anotherAikman,
Thank you for your help. I currently have the following version of the Java.
{color:#800000}java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Client VM (build 14.3-b01, mixed mode, sharing)
{color:#000000}{color:#000000}Does it mean I have Java SE Version 6 Update 17 and you are suggesting me to download the Java EE Version 6?{color} If this is correct, can you please let me know what difference does it make?
I am now going to install the Java EE 6 and try this out.
Thank you for your help.{color}
{color:#000000}Thanks,
Chubha{color}
{color} -
Use a String to get data from a variable?
Hi, I've got a major problem, I need to get data (int []) from a variable, using a String with the name of the variable..
Does anyone know if this is possible?
public class Commands {
private static final int[] deploy_1 = {64,37,73,1};
private static final int[] deploy_2 = {4,167,6,51};
/** Creates a new instance of Commands */
public Commands() {
public int[] get(String name)
// what code here?
}I should be getting the data with
int[] command = Commands.get("deploy_1");
or something like that...
Please help me!
FYI, a hashtable is not a option!
Many thanks, Vikkojava.lang.NoSuchFieldException: deploy_1
at java.lang.Class.getField(Class.java:1507)
at dumb_commandstest.Commands.get(Commands.java:30)
at dumb_commandstest.Main.getData(Main.java:36)
at dumb_commandstest.Main.<init>(Main.java:21)
at dumb_commandstest.Main.main(Main.java:28)
Any ideas why I get a NoSuchFieldException?
deploy_1 does exist. -
Using SQL view object to create ADF table
Hi,
I have created a column called "Month" (which extracts month from the date column) and another column to count the no. of requests.
i want to create an ADF table with 2 columns, a column showing the month and another is showing the no. of requests for that month.
However, now I only managed to achieve the ADF table to show the overall total requests, which means if i add up all the requests for all the months and i get 500
My ADF table shows this:
Jan: 500
Feb: 500
Mar: 500
How should I create the view or what should I do to make it such that the no. of request is based on the month?
Please advice.
Thanks (:Hi,
For the given situation you can create a Query Based View Object with the following query
SELECT
COUNT(TEMP1.DT) REQUEST,
TO_CHAR(TEMP1.DT, 'Mon') MONTH
FROM
TEMP1
GROUP BY
TO_CHAR(TEMP1.DT, 'Mon')
where DT is the date column and temp1 is the name of the database table.
Following are the steps that i followed to get this query :
i have taken the following sample table :
create table temp1
(srno number primary key,
dt date)
*Note you may use any existing column instead of srno or use dt only (i took an extra column as u know we need a primary key /row id)
the following is the sample data
insert into temp1 values (1,sysdate);
insert into temp1 values (2,sysdate);
insert into temp1 values (3,add_months(sysdate,1));
insert into temp1 values (4,add_months(sysdate,1));
insert into temp1 values (5,add_months(sysdate,3));
insert into temp1 values (6,add_months(sysdate,5));
the table appears as follows
SRNO DT
1 22-JUN-12
2 22-JUN-12
3 22-JUL-12
4 22-JUL-12
5 22-SEP-12
6 22-NOV-12
To start with ADF View Object Creation (Using Jdeveloper 11.1.2):
Create the view object using Create View Object wizard
In Step 1. Name window
set the value for Name : Viewab (you can use any of ur choice)
In the data source section : select query
In Step 2. Query window
a. Click Query builder (it will pop up sql statment window)
b. In the SQL Statement window
in quick-pick objects section -> select temp1 table -> shuttle the columns from available list to selected list
in select clause section -> select srno column from select list-> choose count() function from function drop down list -> insert function -> set alias to REQUEST-> click validate
now select dt column from select list -> choose to_char() function -> click insert function -> alter the function to to_Char(temp1.DT,'Mon') -> set alias to Month -> click validate
in the group by clause section -> Click the green symbol to add -> from the expression palette insert dt column -> insert the to_char function -> alter the function to to_char(temp1.DT,'Mon') -> click validate
in the Entire SQL Query section -> click test query -> in the test query window -> click query result-> you will see the result -> click close -> click ok
Click next
Step 3: Bind Variables
Click Next
Step 4: Attribute Mappings
click Finish
So the view object is ready :) -
Error while importing the tables from MySQL using the data source connection
Hi,
I am trying to import tables from MySQL into Powerpivot using the data source connection, if use the import using the Query option its working fine but not with the select list of table option.
when i click on the select list of tables option, i get the below error after selecting all the tables to be imported:
OLE DB or ODBC error.
An error occurred while processing table 'XXXXXXXXXX'.
The current operation was cancelled because another operation in the transaction failed.Hi Bharat17an,
Please provide the detail information when create the MySQL connection in your PowerPivot model. Here is a good article regarding "how to Use MySQL and Microsoft PowerPivot Together" for your reference, please see:
http://www.datamensional.com/2011/09/how-to-use-mysql-and-microsoft-powerpivot-together-2/
If this issue still persists, please help to collection windows event log information. It maybe helpful for us to troubleshoot this issue.
Regards,
Elvis Long
TechNet Community Support -
How to use a excel file to create a service component?
Dear all,
I want to use a excel file to create a service to be my data source. I used the wizard to do that but i always got a message. "The data format is not valid, fields in each record must be delimited by tab charactors, and each record seperated by new line charactors". How should I reformat my excel file to fit the requirements? I have already chang the field`s format into 'text' type. Thx ^^Hi Louis,
[Here|http://img125.imageshack.us/my.php?image=exceltestlo7.jpg] is the result of your data. I downloaded your excel sheet and created a simulated service in 7.1.1 and it works fine.
Below are the steps:
1. Go to Tools -> service component wizard
2. The popup opens : Step1 : Enter the name of your service component
3. Go to Excel spreadsheet Copy the data for which the service needs to be created.
4. Step 2 : Paste the copied Excel data in the popup
5. Step 3 : Define Input -> just click next
6. Step 4: Define Conditions -> just click finish.
Let me know if it helps.
Good Luck,
Dharmi -
What is the use of Multiple source in Logical Table under BMM Layer?
what is the use of Multiple source in Logical Table under BMM Layer?
thanks in advanceOr more generally speaking:
To create a "logical table" consisting of multiple "physical tables"...hence the names. It's the backbone of the whole BI server concept and the way the rpd handles the requests.
I.e.: how would you otherwise proceed for making an analyzable table from SAP, Teradata, Oracle and a flat file with no full change-access to all the data sources? -
How to define data-sources-alias.xml to use Oracle data source
Hi,
I created Oracle jdbc Data Source named "MYDS" in Visual Admin. I added the alias = MYDS_ALIAS. I set the Initial Connection to 2. On the Monitor tab, I see a green line running across the screen. The datasource MYDS is connected to the Oracle.
Now, I would like to define "data-sources-alias.xml" to use MYDS.
When creating data-source-aliases.xml it creates the alias by default on ${com.sap.datasource.default} which is the default DB.
I followed the link --> How to point data-source-aliases.xml to another Datasource
and my data-sources-alias.xml is now:
<data-source-aliases>
<aliases>
<data-source-name>$</data-source-name>
<alias>BRANCH50DS</alias>
</aliases>
</data-source-aliases>
The "EAR generatation has finished successfully", but when "Deploy to J2EE Engine", I got the error below:
1) How to define data-sources-alias.xml to use Oracle data source?
2) I found the link (SDA Deployment error) talking about "sda-dd.xml". How to create "sda-dd.xml" and make it use substitution variables "MYDS"
Dec 20, 2005 3:53:41 PM /userOut/deploy (com.sap.ide.eclipse.sdm.threading.DeployThreadManager) [Thread[Deploy Thread,5,main]] INFO:
[003]Additional log information about the deployment
<!LOGHEADER[START]/>
<!HELP[Manual modification of the header may cause parsing problem!]/>
<!LOGGINGVERSION[1.5.3.7181 - 630_SP]/>
<!NAME[C:\usr\sap\J2E\JC00\SDM\program\log\sdmcl20051220205339.log]/>
<!PATTERN[sdmcl20051220205339.log]/>
<!FORMATTER[com.sap.tc.logging.TraceFormatter(%24d %s: %m)]/>
<!ENCODING[Cp1252]/>
<!LOGHEADER[END]/>
Dec 20, 2005 3:53:39 PM Info: -
Starting deployment -
Dec 20, 2005 3:53:39 PM Info: Loading selected archives...
Dec 20, 2005 3:53:39 PM Info: Loading archive 'C:\usr\sap\J2E\JC00\SDM\program\temp\temp856850022Ear.ear'
Dec 20, 2005 3:53:40 PM Info: Selected archives successfully loaded.
Dec 20, 2005 3:53:40 PM Info: Actions per selected component:
Dec 20, 2005 3:53:40 PM Info: Update: Selected development component '50022Ear'/'sap.com'/'localhost'/'2005.12.20.15.53.28' updates currently deployed development component '50022Ear'/'sap.com'/'localhost'/'2005.12.19.18.39.12'.
Dec 20, 2005 3:53:40 PM Info: Saved current Engine state.
Dec 20, 2005 3:53:40 PM Info: Error handling strategy: OnErrorStop
Dec 20, 2005 3:53:40 PM Info: Update strategy: UpdateAllVersions
Dec 20, 2005 3:53:40 PM Info: Starting: Update: Selected development component '50022Ear'/'sap.com'/'localhost'/'2005.12.20.15.53.28' updates currently deployed development component '50022Ear'/'sap.com'/'localhost'/'2005.12.19.18.39.12'.
Dec 20, 2005 3:53:40 PM Info: SDA to be deployed: C:\usr\sap\J2E\JC00\SDM\root\origin\sap.com\50022Ear\localhost\2005.12.20.15.53.28\temp856850022Ear.ear
Dec 20, 2005 3:53:40 PM Info: Software type of SDA: J2EE
Dec 20, 2005 3:53:40 PM Info: ***** Begin of SAP J2EE Engine Deployment (J2EE Application) *****
Dec 20, 2005 3:53:41 PM Info: Begin of log messages of the target system:
05/12/20 15:53:40 - ***********************************************************
05/12/20 15:53:41 - Start updating EAR file...
05/12/20 15:53:41 - start-up mode is lazy
05/12/20 15:53:41 - com.sap.engine.deploy.manager.MissingSubstitutionException: Missing substitution value for variable [MYDS].
at com.sap.engine.deploy.manager.DeployManagerImpl.makeTempEar(DeployManagerImpl.java:3727)
at com.sap.engine.deploy.manager.DeployManagerImpl.makeNewEar1(DeployManagerImpl.java:3695)
at com.sap.engine.deploy.manager.DeployManagerImpl.deployUpdateAction(DeployManagerImpl.java:523)
at com.sap.engine.deploy.manager.DeployManagerImpl.update(DeployManagerImpl.java:512)
at com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performDeployment(EngineApplOnlineDeployerImpl.java:196)
at com.sap.sdm.serverext.servertype.inqmy.extern.EngineDeployerImpl.deploy(EngineDeployerImpl.java:96)
at com.sap.sdm.serverext.servertype.inqmy.EngineProcessor.executeAction(EngineProcessor.java:224)
at com.sap.sdm.app.proc.deployment.impl.PhysicalDeploymentActionExecutor.execute(PhysicalDeploymentActionExecutor.java:60)
at com.sap.sdm.app.proc.deployment.impl.DeploymentActionImpl.execute(DeploymentActionImpl.java:186)
at com.sap.sdm.app.proc.deployment.controllers.internal.impl.DeploymentExecutorImpl.execute(DeploymentExecutorImpl.java:46)
at com.sap.sdm.app.proc.deployment.states.eventhandler.ExecuteDeploymentHandler.executeAction(ExecuteDeploymentHandler.java:83)
at com.sap.sdm.app.proc.deployment.states.eventhandler.ExecuteDeploymentHandler.handleEvent(ExecuteDeploymentHandler.java:60)
at com.sap.sdm.app.proc.deployment.states.StateBeforeNextDeployment.processEvent(StateBeforeNextDeployment.java:127)
at com.sap.sdm.app.proc.deployment.states.InstContext.processEventServerSide(InstContext.java:73)
at com.sap.sdm.app.proc.deployment.states.InstContext.processEvent(InstContext.java:59)
at com.sap.sdm.app.sequential.deployment.impl.DeployerImpl.doPhysicalDeployment(DeployerImpl.java:127)
at com.sap.sdm.app.sequential.deployment.impl.DeployerImpl.deploy(DeployerImpl.java:96)
at com.sap.sdm.apiimpl.local.DeployProcessorImpl.deploy(DeployProcessorImpl.java:67)
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:324)
at com.sap.sdm.is.cs.remoteproxy.server.impl.RemoteProxyServerImpl.requestRemoteCall(RemoteProxyServerImpl.java:127)
at com.sap.sdm.is.cs.remoteproxy.server.impl.RemoteProxyServerImpl.process(RemoteProxyServerImpl.java:38)
at com.sap.sdm.apiimpl.remote.server.ApiClientRoleCmdProcessor.process(ApiClientRoleCmdProcessor.java:81)
at com.sap.sdm.is.cs.session.server.SessionCmdProcessor.process(SessionCmdProcessor.java:67)
at com.sap.sdm.is.cs.cmd.server.CmdServer.execCommand(CmdServer.java:76)
at com.sap.sdm.client_server.launch.ServerLauncher$ConnectionHandlerImpl.handle(ServerLauncher.java:280)
at com.sap.sdm.is.cs.ncserver.NetCommServer.serve(NetCommServer.java:43)
at com.sap.sdm.is.cs.ncwrapper.impl.ServiceWrapper.serve(ServiceWrapper.java:39)
at com.sap.bc.cts.tp.net.Worker.run(Worker.java:50)
at java.lang.Thread.run(Thread.java:534)
05/12/20 15:53:41 - ***********************************************************
Dec 20, 2005 3:53:41 PM Info: End of log messages of the target system.
Dec 20, 2005 3:53:41 PM Info: ***** End of SAP J2EE Engine Deployment (J2EE Application) *****
Dec 20, 2005 3:53:41 PM Error: Aborted: development component '50022Ear'/'sap.com'/'localhost'/'2005.12.20.15.53.28':
Caught exception during application deployment from SAP J2EE Engine's deploy API:
com.sap.engine.deploy.manager.MissingSubstitutionException: Missing substitution value for variable [MYDS].
(message ID: com.sap.sdm.serverext.servertype.inqmy.extern.EngineApplOnlineDeployerImpl.performAction(DeploymentActionTypes).DMEXC)
Dec 20, 2005 3:53:41 PM Info: J2EE Engine is in same state (online/offline) as it has been before this deployment process.
Dec 20, 2005 3:53:41 PM Error: -
At least one of the Deployments failed -Hi,
If you remove the $ and braces (as shown below) it will work.
<data-source-aliases>
<aliases>
<data-source-name>MYDS</data-source-name>
<alias>BRANCH50DS</alias>
</aliases>
</data-source-aliases>
Regards,
S.Divakar -
PO Attachments using Carry Out Sourcing not transferred to Backend
Hi SDN Team,
I have an issue with PO Attachments using Carry Out Sourcing.
The version I am using is SRM 5.0 which is connected to SAP ECC 6.0.
The necessary configurations for attachments are made in ECC.
When I create a SC through the normal procedure, with PR and PO getting created, the Attachments are getting transferred to the backend ECC, with the following code in the BADI BBP_CREATE_PO_BACK, method FILL_PO_INTERFACE.
Code :
clear cv_attach_use_url.
cv_attach_transfer_active = 'X'.
cv_attach_be_doc_type = 'SRM'.
cv_attach_be_storage_cat = 'DMS_C1_ST'.
But, when I create a SC, then create a PO via Carry Out Sourcing, that is the direct PO without PR getting created, the attachments are not flowing to the backend system.
1. Now, is there any specific settings which needs to be made for PO Attachments using Carry out sourcing?
2. I am aware of the BADI "BBP_CREATE_BE_PO_NEW", but even that is not helping me at the moment.
3. There are no entries created in the table BBP_PDATT too, also no document is created in CV02N tcode in ECC.
Since I am new to SRM, your valuable suggestions, would be of great help.
Thanks for your assistance in advance.
Best Regards,
Arun.Please use program BBP_REQREQ_TRANSFER to create PO in R/3.Let me know you face further problem.
Sanjay
Maybe you are looking for
-
HT5312 how to reset security questions & answer without rescue email?
Please anyone help on this situation where i dnot remember my id security questions Answer.. how to get it reset it .. Also dnot know abt rescue email and how it works... please any one
-
Disappearing Report a Problem button iTunes 10.6
OS 10.6.8 iTunes 10.6 I am an iTunes match user and I have a song that I purchased a year or so ago that will not stream or download. The song it by the Ting Tings "That's Not My Name" Anyway, I try to report the problem from my account purchase hist
-
Business Intelligence java platform SDK
Hey guys, I want to work out the advantages of the BI Java platform SDK. For this I have some guides. At first I want to start with the BI Java SDK Development Guide. Already at the beginning I have a problem. I thought if I include the libarys from
-
Hi, I need to move a user from one mailbox store to another in Exchange 2007 using OIM. From what I could gather, there is no task for this. Is there a way to create a task that executes this modification (move user)? Thanks
-
SM30 going to dump for a Ztable whose fields I recently changed
Hi All, Need to resolve a very urgent issue. We added a new field to a Ztable in DEV & hit the table maintenance generator with screen 8. However when I transport these changes to TS1, the SM30 transaction goes into dump with the error stating scree