How to read a BLOB (base64 - stream) from XML-file in ORACLE10
ORACLE 10g
PL/SQL function
MY XML-file:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<slo xmlns="http://www.example.org/detection">
<LekKey>1999_036371_509627</LekKey>
<HuiNum>46</HuiNum>
<Res></Res>
<InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
<XWGS>3.637028</XWGS>
<YWGS>50.962667</YWGS>
<Pei>EANDIS</Pei>
<DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
<Kan> </Kan>
<Doc>UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAA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NldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
pQQAALNCCQAAAA==</Doc>
</slo>
I have to write an PL/SQL function where I can read all the data in the XML-file (see attach).
In this XML there is a BLOB stored (base64 - stream -> that contains always a MSWORD document).
1) how can I extract this BLOB + the other data in the XML and save this data in a ORACLE table?
2) how can I decode this BLOB and save this MSWORD-document to a fileserver?
First extract your data as CLOB (as it's character based)...
SQL> ed
Wrote file afiedt.buf
1 with t as (select xmltype('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <slo xmlns="http://www.example.org/detection">
3 <LekKey>1999_036371_509627</LekKey>
4 <HuiNum>46</HuiNum>
5 <Res></Res>
6 <InfLig>TEST STRUI AFGESTORVEN - PLAANSTRAAT 46</InfLig>
7 <XWGS>3.637028</XWGS>
8 <YWGS>50.962667</YWGS>
9 <Pei>EANDIS</Pei>
10 <DatPei>1999-11-30T10:17:36.000+01:00</DatPei>
11 <Kan> </Kan>
12 <Doc>UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAAEQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADaAAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2ICwEAALoBAAAUAAAAAAAA
AAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAAIQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIApQQAALNCCQAAAA==</Doc>
13 </slo>') as xml from dual)
14 --
15 -- end of test data
16 --
17 select x.*
18 from t
19 ,xmltable(xmlnamespaces(default 'http://www.example.org/detection'),
20 '/slo'
21 passing t.xml
22 columns lekkey varchar(30) path './LekKey'
23 ,doc clob path './Doc'
24* ) x
SQL> /
LEKKEY DOC
1999_036371_509627 UEsDBBQABgAIAAAAIQB5gHbnswEAAHcGAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAACAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAADA4CQB3b3JkL2ZvbnRUYWJsZS54bWxQSwECLQAUAAYACAAAACEAp/3kQ44BAADeAgAA
EQAAAAAAAAAAAAAAAACYOgkAZG9jUHJvcHMvY29yZS54bWxQSwECLQAUAAYACAAAACEAqchcqowAAADa
AAAAEwAAAAAAAAAAAAAAAABdPQkAY3VzdG9tWG1sL2l0ZW0xLnhtbFBLAQItABQABgAIAAAAIQBgX/2I
CwEAALoBAAAUAAAAAAAAAAAAAAAAAEI+CQB3b3JkL3dlYlNldHRpbmdzLnhtbFBLAQItABQABgAIAAAA
IQDQwaCR/gEAAGgEAAAQAAAAAAAAAAAAAAAAAH8/CQBkb2NQcm9wcy9hcHAueG1sUEsFBgAAAAASABIA
pQQAALNCCQAAAA==
SQL>Then, you can convert the CLOB to a BLOB by doing your base64 decoding.
Similar Messages
-
How to read and write a data from extrenal file
Hi..
How to read and write a data from extrenal file using Pl/sql?
Is it possible from Dyanamic Sql or any other way?
Reagards
Rajuutl_file
Re: How to Create text(dat) file.
Message was edited by:
jeneesh -
How to display data in combo box from xml file.
Hi All,
I have the data in xml file.
<jukebox>
<song>
<title>When the Levee Breaks</title>
<artist>Kansas Joe and Memphis Minnie</artist>
<url>delhi601(www.songs.pk).mp3</url>
</song>
<song>
<title>Better Leave that Stuff Alone</title>
<artist>Will Shade</artist>
<url>delhi601(www.songs.pk).mp3</url>
</song>
<song>
<title>Walk Right In</title>
<artist>Cannon's Jug Stompers</artist>
<url>delhi601(www.songs.pk).mp3</url>
</song>
</jukebox>
and i want to display the only url in combo box list. for that how can load this xml file and how can i show.
Can any one help me.
thanks
Raghu.Raghuvasa,
Get the XML file data into an XML variable in your code, say var jukebox: xml. Then do
combo.dataProvider = jukebox.song.url
or as a shortcut
combo.dataProvider = jukebox.descendants("url")
The latter will pull out elements with tag name url at any depth in the xml structure, so sometimes you have to be careful, but in your case there should be no problem.
Richard -
How to read data in correct format from EXCEL file into an internal table??
Hi Experts,
My requirement is to upload data from an excel file on presentation server into an internal table on <b>SRM</b> server.
I used 'GUI_UPLOAD' function module to achieve the same but all the the data is getting uploaded in # only.I had set in the 'HAS_FIELD_SEPARATOR' to 'X' to overcome this problem.
But all the efforts are in vain. The function module 'ALSM_EXCEL_TO_INTERNAL_TABLE' doesn't exist on SRM Server and I am not getting any other function module having similar functionality available on SRM server.
I have written the following code:-
TYPES: BEGIN OF ty_addr_loc,
userid TYPE xubname, "User Id
addr_code TYPE char4, "3 Digit Site Location Code/4 Digit
"Alternate Address
loc_id TYPE bbp_location, "Indicator: Address is standard address
END OF ty_addr_loc.
*Retrieving file name
parameters: p_file type rlgrap-filename.
DATA:
Local variable holding file name
l_file TYPE string,
Local Variable holding the file type,
l_type TYPE filetype VALUE 'ASC',
Local Variable holding the field separator
l_sep TYPE char01,
i_tab type standard table of ty_addr_loc.
Clearing local variables
CLEAR:
l_file,
l_sep.
Initializing the local variables
MOVE p_file TO l_file.
l_sep = 'X'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = l_file
filetype = l_type
has_field_separator = l_sep
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = i_tab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17
IF sy-subrc <> 0.
Throwing an information message
MESSAGE i003. "Data Upload Failed
LEAVE LIST-PROCESSING.
ENDIF.
Please tell me a way out. I have to make a delivery urgently.
Thanks in advance,
Swati GuptaHi
Try the FM <b>KCD_EXCEL_OLE_TO_INT_CONVERT</b>
Sample:
call function 'KCD_EXCEL_OLE_TO_INT_CONVERT'
exporting
filename = i_filename
i_begin_col = l_begin_col
i_begin_row = l_begin_row
i_end_col = l_end_col
i_end_row = l_end_row
tables
intern = xt_intern
exceptions
INCONSISTENT_PARAMETERS = 201
UPLOAD_OLE = 201.
if sy-subrc <> 0.
e_subrc = sy-subrc.
exit.
endif.
<b>reward if Helpful.</b> -
How to read and update the value of property file
Hi,
I am not able read the values from property file.
Please tell me how to read and update the values from property file using Properties class
This is my property file : - Config.properties its located in D:\newfolder
Values
SMTP = localhost
Now i need to change the value of the SMTP
New value :
SMTP =10.60.1.9
Pls Help me
Thanks
Merlin Rosina,Post a small (<1 page) example program that forum members can copy and run that demonstrates your problem.
-
Reading data From XML file and setting into ViewObject to Pouplate ADF UI
Hi,
I have following requirement.
I would like to read data from XML file and populate the data in ViewObject so that the data can be displayed in the ADF UI.
Also when user modifies the data in the ADF UI, it should be modified back into to ViewObject.
Here is an example - XML file contains Book Title and Author. I would like to read Book Title and Author from XML file and set it into ViewObject Attribute and then display Book title and Author in ADF UI page. Also when user modifies Book title and Author, I would like to store it back in View Object.
Please help me with this requirement and let me know if any solution exist in ADF, for populating the ADF UI screen fields with external XML file data.
ThanksRead chapter 42 http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvvo.htm of the fusion developer guide
Section 42.7, "Reading and Writing XML"
Section 42.8, "Using Programmatic View Objects for Alternative Data Sources"
Timo -
Insert data into oracle table from XML file
I need to insert data into oracle table from XML file
If anybody handled this type of scenario, Please let me know how to insert data into oracle table from XML file
Thanks in advanceThe XML DB forum provides the best support for XML topics related to Oracle.
Here's the FAQ on that forum:
XML DB FAQ
where there are plenty of examples of shredding XML into Oracle tables and such like. ;) -
How to read data in binary form from file?
Hi,
i try to write an implementation of LZW. I need to read data in binary form from a file. How can i do that? I cannot find something like "binary input stream" ...
ThanksHi,
i try to write an implementation of LZW. I need to
read data in binary form from a file. How can i do
that? I cannot find something like "binary input
stream" ...
ThanksInputStream reads bytes. I don't understand your question. -
How to read a tab seperated data from a text file using utl_file
Hi,
How to read a tab seperated data from a text file using utl_file...
I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....
Thanks in advance...
NaveenNaveen Nishad wrote:
How to read a tab seperated data from a text file using utl_file...
I know if we use UTL_FILE.get_line we can read the whole line...but i need to read the tab separated value separately.....If it's a text file then UTL_FILE will only allow you to read it a line at a time. It is then up to you to split that string up (search for split string on this forum for methods) into it's individual components.
If the text file contains a standard structure on each line, i.e. it is a fixed delimited structure, then you could use external tables to read the data instead. -
How to retrieve image from XML file
Hi All,
I am new to XML. So any best guidance is appreciated.
The application requirement is to display image retrived from uploaded xml file in file upload section of our application. And store that image in database.
In my XML file , images & strings & numbers & booleans are there . I am able to save everything in database except images .
I am using JSF, Seam & Hibernate combination. In my Hibernate entity class i took BLOB datatype for image.
I am using following tags in my Xhtml file to display image
<s:graphicImage value="#{hibernateentitybean.picBlobtype}" height="200" width="200">
<s:transformImageSize width="200" height="200" />
<s:transformImageType contentType="image/jpeg"/>
But image is not displayed in Xhtml file
I am using org.w3c.dom.Document for retrieving node name & corresponding value in that node in XML file.
I am getting code like below for Image when i am logging all values from XML files in my bean class .
x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl
I want to convert this value to image. So i can convert image to bytes and store in BLOB.
Can anyone guide me ? or any other approach .
Thanks in advance for any reply.
Regards,
NareshDan_Koldyr wrote:
agree, it's really odd. Just reread OP and it says:
NareshDharmiVatsal wrote:
want to convert this value to image. In any case it doesn't get worth then another single code line:
final String cdata = "x0lGQRQAAAABAAAAAAAAAFJHAQARAAAAVwBhAHQAZQByACAAbABpAGwAaQBlAHMALgBqAHAAZwAAAP/Y/+AAEEpGSUYAAQIBAGAAYAAA/+0YLl";
final sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder();
final byte[] data = decoder.decodeBuffer(cdata);
Blob blob = new SerialBlob(data);//or what ever other DB-specific blob implementaiton Did i answered original question? Any more comments to my first replay?I can comment on this latest code. The package sun.misc is private to Sun (Oracle now of course). It is undocumented and may change or be removed altogether in a future release. There is a good free open source Base64 decoder in the Jakarta Commons Codec library. -
Live Streaming from Video File
Hi everyone,,, im newbie in programming streaming video with flash....ater reading documentations i tried the instructions on doc, i got a question that i've not been solved. How to make a "live streaming" from "video file". It likes a live streaming from camera but it uses video file as the source.... many thanks
Do you mean you have video file but you want to publish it as live stream , am i right? If yes following is the solution, but before that let me clarify you will need server to do it , i mean there is no way Flash client (i.e. .swf file running in Flash Player) can publish file from local disk.
Now let me tell you how to do it from server:
Place your video file under "streams" folder of your application i.e. say "myVideo.flv" under <FMS root>/applications/myApp/streams/_definst_
Now write following code in your main.asc file (this file would be under <FMS root>/applications/myApp )
var mystream;
application.onAppStart = function(){
mystream = Stream.get("livestream");
mystream.play("myVideo",0,-1,true);
This will publish "myVideo" file as live stream under name of "livestream". Client would have to subscriber using NetStream and
use ns.play("livestream",-1,-1)
You might have to write some extra code if you want to loop same file else once play of recorded file gets over , live publish will automatically stop.
let me know if this solves your problem -
I want to load a sales order from xml file. How can I do.
Hi,
I want to load a sales order from XML file. How can I do ? how can i create the sales order?
what are the necessary setting for create the sales orders.
with Regards,
Prakesh.Three options come to my mind.
Option 1: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (BAPI) and Program (CREATEFROMDAT2).
Option 2: Use SAP transaction SXDA_TOOLS (Object Type BUS2032), Program Type (DINP) and Program (RVINVB10).
Option 3: Translate the xml to IDoc so that ORDER04 / ORDER05 Idoc can be used to create Sales order (WEDI transaction). -
How to edit the existing data in the XML file from java programming.
Hi all
i am able to create XML file with the sample data as below from java programming.
i need sample code on how to edit the existing data in the XML file?
for example
<?xml version="1.0"?>
<mydata>
<data1>
<key1>467</key1>
<name1>Paul</name1>
<id1>123</id1>
</data1>
<data2>
<key2>467</key2>
<name2>Paul</name2>
<id2>123</id2>
</data2>
</mydata>
i am able to insert the data in the XML.
now i need sample code on how to modify the data in the above XML file from the java programming for only key2,name2,id2 tags only. the remaining tags data in the XML file i want to keep same data except for key2,name2,id2 which are i want to modify from java code
Regards
Sunil
[points will be always rewardable]hi
u need a parser or validate the xml file for to read the xml file from java coding u need for this
xml4j.jar u can download this file from here
http://www.alphaworks.ibm.com/tech/xml4j
or we can use the SAX(simple API for XML)
some sample applications for this
http://www.java-tips.org/java-se-tips/javax.xml.parsers/how-to-read-xml-file-in-java.html
http://www.developertutorials.com/tutorials/java/read-xml-file-in-java-050611/page1.html
http://www.xml-training-guide.com/e-xml44.html
let me know u need any other info
bvr -
Reading and writing to and from a file to a form
Hi there
I would like somebody to send me a code example,
showing me how to reading records from a file to a form,
and writing records to the same file from the same form.
I know that I have to use sycronize, but I just have not been
successful. I can constract forms, go from form to a form,
do buttons, do text fields. I can even read and write from and
to files. However I cannot do is write from a file to a form and
from a form to a file.
could somebody please explain how this done, and could you
please give me a code example. All the books seem to either
deal with forms or with files. None seem to combine both.
I am sure it is very ease to do if ONLY I knew how!!!
thank you very much in advance for you help.I understand that code and I have used it before, however thanks for
trying to help me, it is really appreciated. However, that is not my
problem. I can read and write from a file to the console and vice versa.
what I cannot do, no matter how hard I try, is to write from a file, and
output it in.
I will tell you how far I have got.
I have a MenuFrame class, this is the code for it:
package WorkflowApp;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
public class MenuFrame extends JFrame {
JMenuBar menuBar1 = new JMenuBar();
JMenu menuFile = new JMenu();
JMenuItem menuFileExit = new JMenuItem();
JMenu menuHelp = new JMenu();
JMenuItem menuHelpAbout = new JMenuItem();
JToolBar toolBar = new JToolBar();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JButton jButton3 = new JButton();
ImageIcon image1;
ImageIcon image2;
ImageIcon image3;
JLabel statusBar = new JLabel();
Button button2 = new Button();
Button button3 = new Button();
Button button4 = new Button();
Button button5 = new Button();
Button button6 = new Button();
Button button7 = new Button();
Button button1 = new Button();
//Construct the frame
public MenuFrame() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
//Component initialization
private void jbInit() throws Exception {
image1 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("openFile.gif"));
image2 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("closeFile.gif"));
image3 = new ImageIcon(WorkflowApp.MenuFrame.class.getResource("help.gif"));
this.getContentPane().setLayout(null);
this.setSize(new Dimension(400, 492));
this.setTitle("MenuFrame");
statusBar.setText(" ");
statusBar.setBounds(new Rectangle(0, 0, 3, 17));
menuFile.setText("File");
menuFileExit.setText("Exit");
menuFileExit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
fileExit_actionPerformed(e);
menuHelp.setText("Help");
menuHelpAbout.setText("About");
menuHelpAbout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
helpAbout_actionPerformed(e);
jButton1.setIcon(image1);
jButton1.setToolTipText("Open File");
jButton2.setIcon(image2);
jButton2.setToolTipText("Close File");
jButton3.setIcon(image3);
jButton3.setToolTipText("Help");
toolBar.setBorder(null);
toolBar.setBounds(new Rectangle(2, 2, 389, 30));
button2.setBounds(new Rectangle(217, 62, 135, 44));
button2.setLabel("Staff Details");
button2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button2_actionPerformed(e);
button3.setBounds(new Rectangle(26, 127, 135, 44));
button3.setLabel("Arange Viewing");
button3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button3_actionPerformed(e);
button4.setBounds(new Rectangle(218, 127, 136, 41));
button4.setLabel("Valuation");
button4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button4_actionPerformed(e);
button5.setBounds(new Rectangle(28, 196, 135, 41));
button5.setLabel("Schedule");
button6.setBounds(new Rectangle(221, 194, 133, 40));
button6.setName("button6");
button6.setLabel("Register Interest");
button7.setBounds(new Rectangle(31, 266, 133, 42));
button7.setLabel("Register Offers");
button1.setBounds(new Rectangle(27, 62, 131, 42));
button1.setLabel("New Client");
button1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button1_actionPerformed(e);
menuFile.add(menuFileExit);
menuHelp.add(menuHelpAbout);
menuBar1.add(menuFile);
menuBar1.add(menuHelp);
this.setJMenuBar(menuBar1);
this.getContentPane().add(statusBar, null);
this.getContentPane().add(toolBar, null);
toolBar.add(jButton1);
toolBar.add(jButton2, null);
toolBar.add(jButton3, null);
this.getContentPane().add(button3, null);
this.getContentPane().add(button5, null);
this.getContentPane().add(button7, null);
this.getContentPane().add(button2, null);
this.getContentPane().add(button4, null);
this.getContentPane().add(button6, null);
this.getContentPane().add(button1, null);
//File | Exit action performed
public void fileExit_actionPerformed(ActionEvent e) {
System.exit(0);
//Help | About action performed
public void helpAbout_actionPerformed(ActionEvent e) {
MenuFrame_AboutBox dlg = new MenuFrame_AboutBox(this);
Dimension dlgSize = dlg.getPreferredSize();
Dimension frmSize = getSize();
Point loc = getLocation();
dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
dlg.setModal(true);
dlg.show();
//Overridden so we can exit on System Close
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if(e.getID() == WindowEvent.WINDOW_CLOSING) {
fileExit_actionPerformed(null);
void button2_actionPerformed(ActionEvent e) {
StaffDetails myFrame = new StaffDetails();
myFrame.show();
void button3_actionPerformed(ActionEvent e) {
ArrangeViewing myFrame = new ArrangeViewing();
myFrame.show();
void button1_actionPerformed(ActionEvent e) {
NewClientFrame myFrame = new NewClientFrame();
myFrame.show();
// System.exit(1);
void button4_actionPerformed(ActionEvent e) {
Valuation myFrame = new Valuation();
myFrame.show();
then I have a new form class, this is the code for it
package WorkflowApp;
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class NewClientFrame extends JFrame {
Label label1 = new Label();
Label label2 = new Label();
Label label3 = new Label();
Label label4 = new Label();
Label label5 = new Label();
Label label6 = new Label();
Label label7 = new Label();
Label label8 = new Label();
Label label9 = new Label();
Label label10 = new Label();
TextField textField1 = new TextField();
TextField textField2 = new TextField();
TextField textField3 = new TextField();
TextField textField4 = new TextField();
TextField textField5 = new TextField();
TextField textField6 = new TextField();
TextField textField7 = new TextField();
TextField textField8 = new TextField();
TextField textField9 = new TextField();
TextField textField10 = new TextField();
Button button1 = new Button();
Button button2 = new Button();
//Construct the frame
public NewClientFrame() {
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
catch(Exception e) {
e.printStackTrace();
//Component initialization
private void jbInit() throws Exception {
this.getContentPane().setLayout(null);
this.setSize(new Dimension(411, 488));
this.setTitle("NewClientFrame ");
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(WindowEvent e) {
this_windowClosing(e);
label1.setBounds(new Rectangle(21, 23, 110, 23));
label1.setAlignment(2);
label1.setText("Assign Number");
label2.setBounds(new Rectangle(23, 57, 108, 25));
label2.setAlignment(2);
label2.setText("Name");
label3.setBounds(new Rectangle(40, 91, 94, 24));
label3.setAlignment(2);
label3.setText("Address 1");
label4.setBounds(new Rectangle(21, 124, 112, 29));
label4.setAlignment(2);
label4.setText("Address 2");
label5.setBounds(new Rectangle(20, 159, 116, 29));
label5.setAlignment(2);
label5.setText("PoscCode");
label6.setBounds(new Rectangle(18, 197, 119, 26));
label6.setAlignment(2);
label6.setText("Telephone");
label7.setBounds(new Rectangle(25, 228, 112, 26));
label7.setAlignment(2);
label7.setText("Other Telephone");
label8.setBounds(new Rectangle(12, 261, 125, 24));
label8.setAlignment(2);
label8.setText("Email Address");
label9.setBounds(new Rectangle(6, 301, 138, 25));
label9.setAlignment(2);
label9.setText("Staff Assigned (Name)");
label10.setBounds(new Rectangle(22, 341, 124, 23));
label10.setAlignment(2);
label10.setText("Staff Assigned (No.)");
textField1.setBounds(new Rectangle(155, 19, 80, 26));
textField2.setBounds(new Rectangle(155, 58, 193, 24));
textField3.setBounds(new Rectangle(156, 90, 192, 25));
textField4.setBounds(new Rectangle(157, 126, 192, 23));
textField5.setBounds(new Rectangle(157, 159, 195, 25));
textField6.setBounds(new Rectangle(157, 194, 195, 26));
textField7.setBounds(new Rectangle(157, 230, 192, 24));
textField8.setBounds(new Rectangle(157, 263, 193, 25));
textField9.setBounds(new Rectangle(157, 303, 196, 24));
textField10.setBounds(new Rectangle(158, 337, 95, 24));
button1.setBounds(new Rectangle(23, 398, 144, 34));
button1.setLabel("Staff Available");
button2.setBounds(new Rectangle(211, 396, 148, 34));
button2.setLabel("Submit Record");
button2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
button2_actionPerformed(e);
this.getContentPane().add(label1, null);
this.getContentPane().add(label2, null);
this.getContentPane().add(label3, null);
this.getContentPane().add(label4, null);
this.getContentPane().add(label5, null);
this.getContentPane().add(label6, null);
this.getContentPane().add(label7, null);
this.getContentPane().add(label8, null);
this.getContentPane().add(label9, null);
this.getContentPane().add(label10, null);
this.getContentPane().add(textField1, null);
this.getContentPane().add(textField2, null);
this.getContentPane().add(textField3, null);
this.getContentPane().add(textField4, null);
this.getContentPane().add(textField5, null);
this.getContentPane().add(textField6, null);
this.getContentPane().add(textField7, null);
this.getContentPane().add(textField8, null);
this.getContentPane().add(textField9, null);
this.getContentPane().add(textField10, null);
this.getContentPane().add(button1, null);
this.getContentPane().add(button2, null);
public void fileExit_actionPerformed(ActionEvent e) {
System.exit(0);
// exit(this);
// close();
//Overridden so we can exit on System Close
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if(e.getID() == WindowEvent.WINDOW_CLOSING) {
System.exit(0);
void button2_actionPerformed(ActionEvent e) {
// myFrame.close();
this.dispose();
void this_windowClosing(WindowEvent e) {
this.dispose();
I also have an about box, staff details, and valuation forms.
what I am trying to do is for the New client form to be able to read and write from and to a file, and display the info.
I am working in JBuilder3, a bit out of date I know, but it is the best I can do. Any Ideas how to do this. -
How to remove Unicode from XML file
I get following error when unmarshal xml:
[java] org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x15) was found in the element content of the document.
Anyone know how to remove Unicode from xml file? Can I remove the unicode by rebuild the file?
ThanksThese sort of error usually occur when you're using a different character encoding to read the file than the one you wrote it with. Perhaps if you were to post the problem section of the file and/or the code that created it in the first place.
Maybe you are looking for
-
Apple website won't play videos "Missing plug-in"
This seems really wierd, no videos on apples website will play. I just get the message "Missing Plug-In" with an arrow but i cant click on it. All other websites play videos no problem. Doesnt seem to have anything to do with Mavericks because it was
-
After the upgrade I had sound for a few seconds then it was gone. I came back in a for a few seconds and then gone again. It's connected to a Yamaha receiver. The optical cable works fine and I haven't had any issues with video through HDMI. Tried a
-
Windows server for doucment storage
Is it possible to use windows server for repository of document? we are using unix server for sap system and wants to use windows server for storing documents and fetch the documets from windows serevr to unix server, Is it possible?
-
cannot install maverick o x without administrator name and password. cannotremember and cannot locate anywhere. HELP!!!
-
I need help! I have two questions........ I recently bought a new Officejet 6500A plus. I have added the eprint service app to my iphone. It does pick up the photos that are on the iphone for printing. Does anyone have a Snapfish account? Is th