Awt Applet storing data in an array
Hi,
I have developed an awt applet which allows user to enter and store information in array. Yet, everytime i run my applet again previous information are lost. Has anyone got an idea of how i can resolve this.
Hi,
The problem is everytime u reload the applet the array gets re initalised and all its previuos contents are lost.
u can try this
use a vector instead of an array to store all the user information and then using ObjectOutputStream write it to a persistable store(eg:- a file or a database)
since vector class is serialiable u can achieve this.
but incase u r planning to write it into a file or insert it into the databse from an Applet u need to set appropriate permmissions for the applet by editing the policy file.
hope that was helpful
Regards,
Partha
Similar Messages
-
Reading and storing data in an array
I'm trying to write a program to read in a list of numbers, store them in an array and then output them in ascending order.
I've written the following so far but when executed, I got this error...
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 100
at ReadingAnArray.main(ReadingAnArray.java:30)
Could someone look at this and tell me where I went wrong?
int[] numList = new int[100];
int number = 0;
int count = 0;
int i, j;
int temp;
System.out.println("Enter up to 100 positive integers ending with " + SENTINEL);
number = console.nextInt();
while (number != SENTINEL)
numList[count] = number;
count++;
for(i=0; i<numList.length; i++)
for(j=i+1; j<numList.length; j++)
if (numList[i] > numList[j])
temp = numList;
numList[i] = numList[j];
numList[j] = temp;
for(i=0; i<numList.length; i++)
System.out.println(numList[i]);
When clicking on the error message, it points to the code line numList[count] = number;Any help is very much appreciated.
ntjava
Message was edited by:
ntjava
Message was edited by:
ntjavaHere's my snippet of code so far. If I entered 12 1 26 15 34 75 -999, it will fill the first 94 lines with 0 and the last 6 in ascending order like
0
0
1
12
15
26
34
75
How do I get it to fill the first 6 elements of the array with my numbers and skip the rest?
System.out.println("Enter up to 100 positive integers ending with " + SENTINEL);
number = console.nextInt();
for(count=0; count < numList.length; count++)
while (number != SENTINEL)
numList[count] = number;
count++;
number = console.nextInt();
for(i = 0; i < numList.length; i++)
for(j= i+1; j < numList.length; j++)
if (numList[i] > numList[j])
temp = numList;
numList[i] = numList[j];
numList[j] = temp;
for(i = 0; i < numList.length; i++)
System.out.println(numList[i]);
Message was edited by:
ntjava -
Having problem with storing data in array
Hi,
I'm having problem on storing data in array. My problem is that each time it loops, the array just keep overwrite instead save to the next index. Like at 0 the value is 123, and 1 is 234. But i having that all data capture all overwrite at 0 till the last data it still show at 0. How do i correct this problem?
Solved!
Go to Solution.How to use array to do comparison? Like Array 1 go thru array 2 to get data Loss out and build an array. Like Array 1 ,1000,1024,1048,etc before 1520 fall in between Array 2 range 1000-1500. So Freq 1000,1024,1048 etc will get Loss value as 1 and 1520 fall in between 1500-2000 will output Loss 2. and so on till the end of the list. How should do this? Need help on this.
Array 1 Array 2
Freq Freq Loss
1000 1000 1
1024 1500 2
1048 2000 3
1100 :
1200 :
: 18000
1520
18000 -
Error while assigning dates to associative array of date type
Hi All,
I am facing the issue while assigning dates to associative array of date type:
Oracle Version:
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
Stored procedure i am trying to write is as following
create or replace procedure jp1 (
p_start_date date default trunc(sysdate,'MM')
, p_end_date date default trunc(sysdate)
is
l_no_of_days number;
type t_date_id is table of date
index by pls_integer;
l_date_id_arr t_date_id;
begin
l_no_of_days := p_end_date - p_start_date;
for i in 0
.. l_no_of_days - 1
loop
l_date_id_arr := p_start_date + i;
dbms_output.put_line(p_start_date + i);
end loop;
end;
I am getting error at line 14 while compiling this. and the error message is as following:
Errors for PROCEDURE JP1:
LINE/COL ERROR
14/5 PL/SQL: Statement ignored
14/22 PLS-00382: expression is of wrong type
So while investigating this i tried to output the value of (p_start_date + i) using dbms_output.put_line and the output is date itself.
create or replace procedure jp1 (
p_start_date date default trunc(sysdate,'MM')
, p_end_date date default trunc(sysdate)
is
l_no_of_days number;
type t_date_id is table of date
index by pls_integer;
l_date_id_arr t_date_id;
begin
l_no_of_days := p_end_date - p_start_date;
for i in 0 .. l_no_of_days-1
loop
--l_date_id_arr := p_start_date + i;
dbms_output.put_line(p_start_date + i);
end loop;
end;
output of the
exec jp1
is as following:
01-DEC-13
02-DEC-13
03-DEC-13
04-DEC-13
05-DEC-13
06-DEC-13
07-DEC-13
08-DEC-13
09-DEC-13
10-DEC-13
11-DEC-13
12-DEC-13
13-DEC-13
14-DEC-13
15-DEC-13
16-DEC-13
17-DEC-13
18-DEC-13
I see the output as date itself. so why it is throwing error while assigning the same to associative array of date type.
I tried to google also for the same but to no avail.
Any help in this regard is appreciated or any pointer some other thread on internet or in this forum.
Thanks in advance
Jagdeep SangwanRead about associative arrays :
create or replace procedure jp1 (
p_start_date date default trunc(sysdate,'MM')
, p_end_date date default trunc(sysdate)
) is
l_no_of_days number;
type t_date_id is table of date
index by pls_integer;
l_date_id_arr t_date_id;
begin
l_no_of_days := p_end_date - p_start_date;
for i in 0..l_no_of_days - 1
loop
l_date_id_arr(i) := p_start_date + i;
dbms_output.put_line(p_start_date + i);
end loop;
end;
Ramin Hashimzade -
(Urgent help needed) how to read txt file and store the data into 2D-array?
Hi, I have a GUI which allow to choose file from the file chooser, and when "Read file" button is pressed, I want to show the array data into the textarea.
The sample data is like this followed:
-0.0007 -0.0061 0.0006
-0.0002 0.0203 0.0066
0 0.2317 0.008
0.0017 0.5957 0.0008
0.0024 1.071 0.0029
0.0439 1.4873 -0.0003
I want my program to scan through and store these data into 2D array.
However for some reason, my source code issues errors, and I don't know what's wrong with it, seems to have a problem in StringTokenizer though. Can anybody help me?
Thanks in advance.
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.StringTokenizer;
public class FileReduction1 extends JFrame implements ActionListener{
// GUI features
private BufferedReader fileInput;
private JTextArea textArea;
private JButton openButton, readButton,processButton,saveButton;
private JTextField textfield;
private JPanel pnlfile;
private JPanel buttonpnl;
private JPanel buttonbar;
// Other fields
private File fileName;
private String[][] data;
private int numLines;
public FileReduction1(String s) {
super(s);
// Content pane
Container cp = getContentPane();
cp.setLayout(new BorderLayout());
// Open button Panel
pnlfile=new JPanel(new BorderLayout());
textfield=new JTextField();
openButton = new JButton("Open File");
openButton.addActionListener(this);
pnlfile.add(openButton,BorderLayout.WEST);
pnlfile.add(textfield,BorderLayout.CENTER);
readButton = new JButton("Read File");
readButton.addActionListener(this);
readButton.setEnabled(false);
pnlfile.add(readButton,BorderLayout.EAST);
cp.add(pnlfile, BorderLayout.NORTH);
// Text area
textArea = new JTextArea(10, 100);
cp.add(new JScrollPane(textArea),BorderLayout.CENTER);
processButton = new JButton("Process");
//processButton.addActionListener(this);
saveButton=new JButton("Save into");
//saveButton.addActionListener(this);
buttonbar=new JPanel(new FlowLayout(FlowLayout.RIGHT));
buttonpnl=new JPanel(new GridLayout(1,0));
buttonpnl.add(processButton);
buttonpnl.add(saveButton);
buttonbar.add(buttonpnl);
cp.add(buttonbar,BorderLayout.SOUTH);
/* ACTION PERFORMED */
public void actionPerformed(ActionEvent event) {
if (event.getActionCommand().equals("Open File")) getFileName();
if (event.getActionCommand().equals("Read File")) readFile();
/* OPEN THE FILE */
private void getFileName() {
// Display file dialog so user can select file to open
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
int result = fileChooser.showOpenDialog(this);
// If cancel button selected return
if (result == JFileChooser.CANCEL_OPTION) return;
if (result == JFileChooser.APPROVE_OPTION)
fileName = fileChooser.getSelectedFile();
textfield.setText(fileName.getName());
if (checkFileName()) {
openButton.setEnabled(false);
readButton.setEnabled(true);
// Obtain selected file
/* READ FILE */
private void readFile() {
// Disable read button
readButton.setEnabled(false);
// Dimension data structure
getNumberOfLines();
data = new String[numLines][];
// Read file
readTheFile();
// Output to text area
textArea.setText(data[0][0] + "\n");
for(int index=0;index < data.length;index++)
for(int j=1;j<data[index].length;j++)
textArea.append(data[index][j] + "\n");
// Rnable open button
openButton.setEnabled(true);
/* GET NUMBER OF LINES */
/* Get number of lines in file and prepare data structure. */
private void getNumberOfLines() {
int counter = 0;
// Open the file
openFile();
// Loop through file incrementing counter
try {
String line = fileInput.readLine();
while (line != null) {
counter++;
System.out.println("(" + counter + ") " + line);
line = fileInput.readLine();
numLines = counter;
closeFile();
catch(IOException ioException) {
JOptionPane.showMessageDialog(this,"Error reading File",
"Error 5: ",JOptionPane.ERROR_MESSAGE);
closeFile();
System.exit(1);
/* READ FILE */
private void readTheFile() {
// Open the file
int row=0;
int col=0;
openFile();
System.out.println("Read the file");
// Loop through file incrementing counter
try {
String line = fileInput.readLine();
while (line != null)
StringTokenizer st=new StringTokenizer(line);
while(st.hasMoreTokens())
data[row][col]=st.nextToken();
System.out.println(data[row][col]);
col++;
row++;
closeFile();
catch(IOException ioException) {
JOptionPane.showMessageDialog(this,"Error reading File",
"Error 5: ",JOptionPane.ERROR_MESSAGE);
closeFile();
System.exit(1);
/* CHECK FILE NAME */
/* Return flase if selected file is a directory, access is denied or is
not a file name. */
private boolean checkFileName() {
if (fileName.exists()) {
if (fileName.canRead()) {
if (fileName.isFile()) return(true);
else JOptionPane.showMessageDialog(null,
"ERROR 3: File is a directory");
else JOptionPane.showMessageDialog(null,
"ERROR 2: Access denied");
else JOptionPane.showMessageDialog(null,
"ERROR 1: No such file!");
// Return
return(false);
/* FILE HANDLING UTILITIES */
/* OPEN FILE */
private void openFile() {
try {
// Open file
FileReader file = new FileReader(fileName);
fileInput = new BufferedReader(file);
catch(IOException ioException) {
JOptionPane.showMessageDialog(this,"Error Opening File",
"Error 4: ",JOptionPane.ERROR_MESSAGE);
System.out.println("File opened");
/* CLOSE FILE */
private void closeFile() {
if (fileInput != null) {
try {
fileInput.close();
catch (IOException ioException) {
JOptionPane.showMessageDialog(this,"Error Opening File",
"Error 4: ",JOptionPane.ERROR_MESSAGE);
System.out.println("File closed");
/* MAIN METHOD */
/* MAIN METHOD */
public static void main(String[] args) throws IOException {
// Create instance of class FileChooser
FileReduction1 newFile = new FileReduction1("File Reduction Program");
// Make window vissible
newFile.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
newFile.setSize(500,400);
newFile.setVisible(true);
Java.lang.NullpointException
at FileReductoin1.readTheFile <FileReduction1.java :172>
at FileReductoin1.readFile <FileReduction1.java :110>
at FileReductoin1.actionPerformed <FileReduction1.java :71>
.1) Next time use the CODE tags. this is way too much unreadable crap.
2) The problem is your String[][] data.... the only place I see you do anything approching initializing it is
data = new String[numLines][];I think you want to do this..
data = new String[numLines][3];anyway that's why it's blowing up on the line
data[row][col]=st.nextToken(); -
Invoking stored procedure that returns array(oracle object type) as output
Hi,
We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
JPA Class:
import java.io.Serializable;
import java.sql.Array;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.eclipse.persistence.annotations.Direction;
import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
import org.eclipse.persistence.annotations.StoredProcedureParameter;
* The persistent class for the MessagePublish database table.
@Entity
@NamedStoredProcedureQuery(name="GetTeamMembersDetails",
procedureName="team_emp_maintenance_pkg.get_user_team_roles",
resultClass=TeamMembersDetails.class,
returnsResultSet=true,
parameters={
@StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
@StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
@StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
@StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
public class TeamMembersDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private long userId;
private List<TeamMembersDetailsOT> teamMembersDetailsOT;
public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
this.teamMembersDetailsOT = teamMembersDetailsOT;
public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
return teamMembersDetailsOT;
Procedure
PROCEDURE get_user_team_roles (
i_user_id IN ue_user.user_id%TYPE
, o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
, i_debugmode IN NUMBER :=0)
AS
OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.A few things.
You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
James : http://www.eclipselink.org -
. NET to call Oracle stored procedure, use an array of types of parameters
. NET to call Oracle stored procedure, use an array of types of parameters
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
Use System.Data.OracleClient
C# Code:
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[] { "11", "22" };
OracleParameter p1 = new OracleParameter("i_test", OracleType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.Value = str;
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleType.Int32);
p2.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 4, 2009 7:13 AM. NET to call Oracle stored procedure, use an array of types of parameters
The use of ODP.net(Oracle 10g), the error is still the same
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
ODP.NET(Oracle 10g)
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[2] { "11", "222" };
cmd.ArrayBindCount=2;
OracleParameter p1 = new OracleParameter("i_test", OracleDbType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p1.Value = str;
p1.ArrayBindSize=new int[2]{2,3};
p1.ArrayBindStatus = new OracleParameterStatus[2]{
OracleParameterStatus.Success,
OracleParameterStatus.Success
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleDbType.Int32);
p2.Direction = ParameterDirection.Output;
P2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p2.Value=0;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 5, 2009 7:48 AM -
SAP paging overflow when storing data in the ABAP/4 memory.
I am trying to create a data source in BI7.0 in the Datawarehousing Workbench. But along the process when i need to select a view i get an error detailed in the following error file extract: Please go through and assist.
untime Errors MEMORY_NO_MORE_PAGING
Date and Time 06.06.2009 14:21:35
Short text
SAP paging overflow when storing data in the ABAP/4 memory.
What happened?
The current program requested storage space from the SAP paging area,
but this request could not be fulfilled.
of this area in the SAP system profile.
What can you do?
Note which actions and input led to the error.
For further help in handling the problem, contact your SAP administrator
You can use the ABAP dump analysis transaction ST22 to view and manage
termination messages, in particular for long term reference.
Error analysis
The ABAP/4 runtime system and the ABAP/4 compiler use a common
interface to store different types of data in different parts of
the SAP paging area. This data includes the
ABAP/4 memory (EXPORT TO MEMORY), the SUBMIT REPORT parameters,
CALL DIALOG and CALL TRANSACTION USING, as well as internally defined
macros (specified with DEFINE).
To store further data in the SAP paging area, you attempted to
allocate a new SAP paging block, but no more blocks were
available.
When the SAP paging overflow occurred, the ABAP/4 memory contained
entries for 20 of different IDs.
Please note:
To facilitate error handling, the ABAP/4 memory was
deleted.
How to correct the error
The amount of storage space (in bytes) filled at termination time was:
Roll area...................... 8176
Extended memory (EM)........... 13587912
Assigned memory (HEAP)......... 0
Short area..................... " "
Paging area.................... 40960
Maximum address space.......... " "
By calling Transaction SM04 and choosing 'Goto' -> 'Block list',
you can display an overview of the current roll and paging memory
levels resulting from active users and their transactions. Try to
decide from this whether another program requires a lot of memory
space (perhaps too much).
The system log contains more detailed information about the
termination. Check for any unwanted recursion.
Determine whether the error also occurs with small volumes of
data. Check the profile (parameter "rdisp/PG_MAXFS", see
Installation Guidelines).
Is the disk or the file system that contains the paging file
full to the extent that it cannot be increased, although it has
not yet reached the size defined in the profile? Is the
operating system configured to accommodate files of such a
size?
The ABAP processor stores different types of data in the SAP
paging area. These include:
(1) Data clusters (EXPORT ... TO MEMORY ...)
(2) Parameters for calling programs (SUBMIT REPORT ...),
Dialog modules (CALL DIALOG ...) and transactions
(CALL TRANSACTION USING ...)
(3) Internally defined program macros (DEFINE ...)
Accordingly, you should check the relevant statements in a program
that results in an overflow of the SAP paging area.
It is critical when many internal tables, possibly with
different IDs, are written to memory (EXPORT).
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MEMORY_NO_MORE_PAGING" " "
"SAPLWDTM" or "LWDTMU20"
"TABC_ACTIVATE_AND_UPDATE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.Hi Huggins,
Maintenance of the Paging File is owned by your basis team.
They should increase this in order for your transaction to process successfully.
Just for your reference, in case the OS used is windows server 2003, paging file value can be checked through;
Right click in the My Computer>properties.
Then go to Advance tab;
Then there should be a performance section, click the settings
Then Advance tab again. The paging file can be seen from there.
(and can be adjusted from there also)
The value of the paging file in general will be dependent with the available RAM from the hardware.
Hope this helps. Thanks a lot.
- Jeff -
hi need help.. i need to add missing data for the array
YY-Year
MM-Month
DD-Date
mm-minutes
ss-seconds
Data 1YYMMDD mmss0
20.8 1090828 05050
1.2 1090829 10150
7.2 1090901 08400
the above array is the data where i need to insert data for data til 090831
as below
Data 1YYMMDD mmss0
20.8 1090828 05050
1.2 1090829 10150
0 1090830 0
0 1090831 0
7.2 1090901 08400
how to do this? and i need to check for every month is there data missing inbetween? Plz help
Solved!
Go to Solution.Yes. You will need to iterate through your array. Index out the current index and the index +1. Translate the text into dates and use the date functions to determine if a date is missing. If not, increase the index by 1 and repeat. If a date is missing, insert a row and set the date to be the last date +1. Repeat increasing your index which should make it the row you just added.
-
Without loops how can i read data from associative Array??
Hi all,
I am facing scenario like...
i need to read data from associative array without using loops is it possible,
CREATE OR REPLACE PACKAGE BODY test_pkg IS
TYPE t1 IS TABLE OF NUMBER INDEX BY BINARY_INTEGER;
-- in array we can expect more than one row or sometimes no data also.
FUNCTION test1(vt1 T1 DEFAULT CAST(NULL AS t1)) RETURN NUMBER IS
BEGIN
-- basically in array we'll get data of column2
-- this loop should satisfies table1.colum2 = nvl(NULL, table2.colum2 )if array is null.
-- if array is not null then only compare with array values
FOR i IN (SELECT t1.colum1,t1.column2
FROM table1 t1, table1 t2
WHERE t1.colum1 = t2.column1
AND t1.colum2 = nvl(vt1, t2.colum2)
LOOP
generateTEXT(i.colum1, i.colum2);
END LOOP;
END test1;
END test_pkg;
in table1 we have date like...
colum1 column2
Jan 1
Feb 2
Mar 3
if i call select test_pkg.test1(1) from dual then output should
be Jan..
and
select test_pkg.test1(null) from dual then it should display all elements from table1.
Jan 1
Feb 2
Mar 3,
Thanks for your quick replay..i need to read data from associative array without using loops is it possible,
No - you would need to create a SQL type and then use the TABLE operator to unnest the collection.
create or replace TYPE my_nums IS TABLE OF INTEGER;
DECLARE
-- TYPE my_nums IS TABLE OF PLS_INTEGER INDEX BY PLS_INTEGER;
v_nums my_nums := my_nums(1, 2, 3);
v_total number;
BEGIN
select sum(column_value) into v_total from table(v_nums);
DBMS_OUTPUT.PUT_LINE
('Sum of the numbers is ' || TO_CHAR(v_total));
END;
Sum of the numbers is 6 -
How can I put data in an array which will be used in SPC plotting
In my program, it will generate data continuously and I would like to store these data time to time in an array. Could you suggest me a method?
For example, 1.77,1.67,1.56,1.89,1.99... (these data generated continuously)
1st second: 1.77 1.67,1.56,1.89,1.99( store in array)
After 1 second: 1.67,1.56,1.89,1.99,1.33 (remove the first one data in the array and replace it with the following generated data)
How can I remove the data in the array and replace it with the other data?
Could you give me some examples?
ThanksCheck the attached VI. It includes two methods. You can choose the one you like. I prefer the bottom one because only one extra memory for the subarray is created. The top one makes two copies because of the resize.
Joe
Attachments:
Simple_Numerical_Que.vi 26 KB -
Why files in Lightroom mobile and files in the creative cloud not the same? idea- one place(stored date) for all application ??????
Lightroom Mobile is not a cloud storage service. You shouldn't treat it as a way of backing up your files. You are merely storing Smart Previews of your files in the cloud space, high-quality JPEGs of your files regardless of their original format on your desktop. The point is that they are there so you can continue editing them in a Lightroom-like environment even while away from your desktop/laptop computer. The files in Lightroom Mobile can only be used in Lightroom Mobile.
This is very different from what is offered by the Creative Cloud storage, which can be used to synchronize your files between any device (that can support the individual files).
The vast difference in how each service works and its intended use is why they are separate. -
How to put data into a array element in the BPEL
Hi,
I have a element in the WSDL which is of type Array. (i.e accepts unlimited data for the same element). How should i put a data into a array in the BPEL.
Example:
The below Example gives u an idea about wht iam asking:pasting a piece of my requirement:
<s:element minOccurs="0" maxOccurs="1" name="parameters" type="tns:ArrayOfCSParameters" />
<s:complexType name="ArrayOfCSParameters">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded"
name="CSParameters" nillable="true" type="tns:CSParameters" />
</s:sequence>
</s:complexType>
<s:complexType name="CSParameters">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="RevenueItem" type="tns:RevenueItem" />
<s:element minOccurs="0" maxOccurs="1" name="AccountURIs" type="tns:ArrayOfString" />
<s:element minOccurs="0" maxOccurs="1" name="GroupURIs" type="tns:ArrayOfString" />
<s:element minOccurs="1" maxOccurs="1" name="Percentage" nillable="true" type="s:decimal" />
</s:sequence>
<s:attribute name="Version" type="s:decimal" use="required" />
<s:attribute name="URI" type="s:string" />
</s:complexType>
Any suggestion is appreciated.
Regards
pavanYou have 2 options i guess.
Use the transformation and the for-each to construct the array-list
or like Richard said, use a loop in bpel, assign in the loop an variable of element type="CSParameters" and append this variable to your variable with accepts the arraylist. -
Error while retrieving data from an ARRAY resultset
We hava an Oracle stroed procedure which has a table type as its OUT parameter and where the data is being entered into. This data requries to be returned to the Java client through a JDBC connection. We have used the OracleTypes' ARRAY object for this. We are facing errors when retieving data from the ARRAY resultset
The Oracle Package
----I created a table type called "PlSqlTable":
CREATE OR REPLACE TYPE PlSqlTable IS TABLE OF VARCHAR2(20);
----I defined this as the out parameter for my procedure :
PROCEDURE testSQL
arrayOutID OUT PlSqlTable
Then populated the object :
arrayOutID := PlSqlTable();
arrayOutID.extend(4);
arrayOutID(1):= 'Hello';
arrayOutID(2) := 'Test';
arrayOutID(3) := 'Ora';
----The procedure executes fine - all debug statements are printed ----right till the end of execution.
The Java class
----Here is how I have defined the parameters :
OracleCallableStatement stmnt = (OracleCallableStatement)connection.prepareCall("begin testSQL(?);end;");
stmnt.registerOutParameter(2,OracleTypes.ARRAY,"PLSQLTABLE");
System.out.println("Executing..");
stmnt.execute();
System.out.println("Executed..");
ARRAY outArray = stmnt.getARRAY(1);
System.out.println("Got array");
ResultSet rset = outArray.getResultSet();
System.out.println("Got Resultset..");
int i = 1;
while(rset.next()){
System.out.println("VALUE : " + rset.getString(i));
i = i+1;
----On execution, the debug messages display :
Executing..
Executed..
Got array
Got Resultset..
VALUE : 1
VALUE : Test
ERROR : java.sql.SQLException: Invalid column index
----But I have populated upto 3 values in th e procedure. Then why this error ?
PLLLEEEASE help me out on this.
Thanks, Sathyahaven't worked with db arrays but I think your problem is here:int i = 1;
while(rset.next()){
System.out.println("VALUE : " + rset.getString(i));
i = i+1;
}In the first loop you are retrieving the value from column 1(rs.getString(1)), which is OK, but in the second loop, you are trying to retrieve a value from the second column(rs.getString(2)) which doesn't exist. Try this code which only reads from column1:
while(rset.next()){
System.out.println("VALUE : " + rset.getString(1));
}Jamie -
The final solution to greek characters in AWT applets(????)
OK. I have searched the whole web and asked whoever I knew. The question was simple: How do I show greek characters in a TextField in an AWT Applet? Some people said that I should change the font properties inside MY jre/lib installation but then I want EVERYONE and not just ME seeing the greek characters! Adding a greek font into the applet's jar was another "solution" but who wants to have an applet of about 2MBs? So I think I have come up to the answer ... ONLY with jre > 1.4.0 somebody could handle greek characters in AWT Applets without trooble! If somebody has managed to show and handle greek characters in a TextField inside an AWT Applet (which I doubt), I would like to know EXACTLY HOW as I am tired of non-working "solutions"! I hope this post saves you from a lot of time searching for the HolyGrail
I haven't worked with a TextField but I worked with a JTextField. My solution wasn't very straightforward but it did the job.
I used this solution in order to work with linux, but you must add an if
statement to check the OS.
If your problem was how to view Greek characters in a non internation version of
Java, then as far as I know, you cannot! Also JDK 1.3.1_01 and j2re 1.4.0_01
use a different way of loading system fonts, so with the latter you cannot use system fonts unless you put them in you java directory.
(I use linux so don't be surprissed if these work different in windows)
import java.io.*;
public class JTextFieldGr extends javax.swing.JTextField {
public JTextFieldGr() {
super();
myInit();
public JTextFieldGr(String text) {
super(text);
myInit();
public void myInit() {
addKeyListener(new java.awt.event.KeyListener() {
public void keyTyped(java.awt.event.KeyEvent evt){
try{
String tmp=""+evt.getKeyChar();
String uk=new String(tmp.getBytes(),"ISO-8859-7");
evt.setKeyChar(uk.charAt(0));
}catch(UnsupportedEncodingException e){
e.printStackTrace();
public void keyPressed(java.awt.event.KeyEvent evt){
public void keyReleased(java.awt.event.KeyEvent evt){
}
Maybe you are looking for
-
Can't get iTunes to recognize iPod
Anyway, I've been getting that picture of the file with an exclamation mark on it. When I put it in my computer, it won't recognize my player at all, just locks up. I reset it, I put it in safe disk mode, and take it out. I'm trying to do a restore o
-
Use variable in SQL for column name
Hi All, We want to use a user input as a column name in APEX. For e.g user will enter "ALLOWABLE_AMOUNT" then the query will be as follows : select Rule,rule_name,rule_desc,"User Input" from rule_dim where "User_input" > 100 So here the User_input w
-
[SOLVED] CTRL+ALT+F? don't working
I don't know when it stopped to work, but today I needed use CTRL+ALT+F? to log in text mode, and it does not work. I don't know where I need start my investigation. System updated every day (and today too). Thanks for any help. Last edited by mkanad
-
User acceptance testing in multi-tenant setup
How do most people do their User Acceptance Testing/QA on the Staging environment given that the availability is not guaranteed?
-
Webtool for query sh-commands from website
Hello First post here but read a lot on the forums. Im looking for a tool or script that we can run on a webserver to allow a second line support to make show commands on our routers/switches. I've been searching online for a while but seemingly can