Process, please help me, real java man
i use following code to execute a command (exceptions are deleted):
String s="java.exe MyClass";
Runtime run=Runtime.getRuntime();
Process pro=run.exec(s);
simple enough, after the code has been executed, we see an interface (i.e. JFrame,if MyClass extends JFrame).
my question is: if user closes MyClass by click close button, in my app, how to know MyClass is destroyed?
very trick, any methods such as Process.waitFor() don't work in the case, because:
1. object Process pro represnts java.exe (not MyClass)
2. MyClass is a process created by java.exe
thx
my question is: if user closes MyClass by click close
button, in my app, how to know MyClass is destroyed?
very trick, any methods such as Process.waitFor()
don't work in the case, because:
1. object Process pro represnts java.exe (not MyClass)
2. MyClass is a process created by java.exe
Obviously you are calling this from a Java program, so you don't need java.exe at all to execute MyClass. Why don't you use:
String args[] = new String[0];
MyClass.main(args);If you add some kind of getExitStatus() to MyClass your problems should be solved...
Thomas
Similar Messages
-
Process, help me, real java man
i use following code to execute a command (exceptions are deleted):
String s="java.exe MyClass";
Runtime run=Runtime.getRuntime();
Process pro=run.exec(s);
simple enough, after the code has been executed, we see an interface (i.e. JFrame,if MyClass extends JFrame).
my question is: if user closes MyClass by click close button, in my app, how to know MyClass is destroyed?
very trick, any methods such as Process.waitFor() don't work in the case, because:
1. object Process pro represnts java.exe (not MyClass)
2. MyClass is a process created by java.exe
thxhi i myself am not a guru but nothing wrong in trying
in the app that i am working i can stop the process in-between
that was possible because i was calling it through a thread
the solution to the problem could be on exit check if the thread is alive() and then you know
new JMenuitem("compile"):
setActionCommand("Compile");
addActionListener(new Compiler());
public class compiler implements ActionListener{
public void actionparformed(ActionEvent e){
String para=e.getActionCommand();new Processer(para);
class Processer implements Runnable{
public processer(String sw){this.s=sw;}
Thread d;
boolean b;
public void start()
d=new Thread(threada.this);
d.setPriority(Thread.MAX_PRIORITY-3);
but.setVisible(true);
b=true;
d.start();
public void run()
System.gc();
if(b==true)
but.setText(" RUNNING "+ d);
but.setToolTipText("CLICK IF YOU WANT TO STOP THE RUNNING THREAD ");
but.addActionListener(
new ActionListener()
public void actionPerformed(ActionEvent we)
try
p.destroy();//p is java.lang.Process
r.gc();//p is java.lang.Process
System.gc();//p is java.lang.Process
b=false;
}catch(Exception ae )
{System.out.println(ae);}
try{
if (s=="Compile")
new compile();
public void stop()
try{
but.setText(" T Stopped .);
but.setToolTipText("CLICK IF YOU WANT TO STOP THE RUNNING THREAD |-> "+Thread.currentThread()+" STOPPED");
System.gc();
d=null;
}catch(Exception ){}so to all given logic if you could directly dispose the active threads or nullify them it could work or
let us say if the thread is alive then we can show a confirm popup asking if they want the process to end or not
of course u have to handle it in WindowClosingEvvent before your System.exit(0); -
Problem with checkboxes in IR report mainly for update process please help
Hello,
Can anyone please help me out with this issue.
I have an interactive report with 3 checkbox item for a single column named status. Based on the value of the column status the check box should be checked. For example:
DECODE(status,'DEV',1,0) as DEV,
DECODE(status,'RVW',1,0) as RVW,
DECODE(status,'PRD',1,0) as PROD,
So for this I have used the apex_item.checkbox item. Below is my report query
SELECT APEX_ITEM.HIDDEN(30,0,'','f30_' || ROWNUM)
|| APEX_ITEM.HIDDEN(31,0,'','f31_' || ROWNUM)
|| APEX_ITEM.HIDDEN(01,ROWNUM,'','f01_' || ROWNUM)
|| APEX_ITEM.HIDDEN(04,CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN,'','f04_' || ROWNUM)
|| APEX_ITEM.HIDDEN(05,CHF_STATUS,'','f05_' || ROWNUM)
|| APEX_ITEM.HIDDEN(06,CHF_STATUS,'','f06_' || ROWNUM)
|| APEX_ITEM.HIDDEN(08,CHF_STATUS,'','f08_' || ROWNUM)
|| APEX_ITEM.HIDDEN(09,CHF_STATUS,'','f09_' || ROWNUM)
|| APEX_ITEM.HIDDEN(11,CHF_STATUS,'','f11_' || ROWNUM)
|| APEX_ITEM.HIDDEN(12,CHF_STATUS,'','f12_' || ROWNUM)
|| APEX_ITEM.CHECKBOX (32,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f30'');"'
,DECODE (0,1, ROWNUM),':','f32_' || ROWNUM) DELETE
,CHF_COLUMN
,CHF_STATUS
,APEX_ITEM.CHECKBOX (07,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f05'');"',DECODE (CHF_STATUS,'DEV',ROWNUM),':','f07_' || ROWNUM)
DEV_EDIT
,APEX_ITEM.CHECKBOX (10,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f08'');"',DECODE (CHF_STATUS,'RVW',ROWNUM),':','f10_' || ROWNUM)
RVW_EDIT
,APEX_ITEM.CHECKBOX (13,ROWNUM,'onClick="javascript:ToggleValue(this,' || ROWNUM || ','||'''f11'');"',DECODE (CHF_STATUS,'PRD',ROWNUM),':','f13_' || ROWNUM)
PRD_EDIT
FROM CHF_COLUMN WHERE
CHF_DATASTORE = 'DOMAIN_DEV' AND
CHF_SCHEMA = 'SCHEMA_DEV' AND
CHF_TABLE = 'EMPLOYEEE'
ORDER BY 1; And I have a button for the update process so that the users can check the checkboxes option for the status column either 'DEV', 'RVW', 'PRD'. The status of the column can be in either of these states or can be null.
I have a update process, its having some problem - I don't understand whats causing the problem. Below is the error message which I encountered when trying to update.
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
My Update process.
DECLARE
l_cnt BINARY_INTEGER := 0;
l_stepid number := 10;
l_date DATE := SYSDATE;
BEGIN
FOR i IN 1 .. apex_application.g_f01.COUNT
LOOP
IF APEX_APPLICATION.G_f05 (i) = 1 THEN
UPDATE CHF_COLUMN
SET CHF_STATUS = 'DEV'
WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
l_cnt := l_cnt + SQL%ROWCOUNT;
apex_application.g_print_success_message := apex_application.g_print_success_message ||
'Successfully updated'||l_cnt ||'<br><br>';
END IF;
IF APEX_APPLICATION.G_f08 (i) = 1 THEN
UPDATE CHF_COLUMN
SET CHF_STATUS = 'RVW'
WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
l_cnt := l_cnt + SQL%ROWCOUNT;
apex_application.g_print_success_message := apex_application.g_print_success_message ||
'Successfully updated'||l_cnt ||'<br><br>';
END IF;
IF APEX_APPLICATION.G_f11 (i) = 1 THEN
UPDATE CHF_COLUMN
SET CHF_STATUS = 'PRD'
WHERE CHF_DATASTORE||CHF_SCHEMA||CHF_TABLE||CHF_COLUMN = APEX_APPLICATION.G_f04 (i)
l_cnt := l_cnt + SQL%ROWCOUNT;
apex_application.g_print_success_message := apex_application.g_print_success_message ||
'Successfully updated'||l_cnt ||'<br><br>';
END IF;
END LOOP;
COMMIT;
END;If you can please have a look at the app, you can get a better understanding of my problem.
Workspace : orton_workspace
username : [email protected]
password : sanadear
Application No: 15089 SAMPLE_CHECKBOX_APP
Thanks,
Orton
Edited by: orton607 on Aug 4, 2010 9:28 AMI could be wrong but maybe change the hidden items to be like:
APEX_ITEM.HIDDEN(05,DECODE(CHF_STATUS,'DEV',1,0),'','f05_' || ROWNUM)
APEX_ITEM.HIDDEN(08,DECODE(CHF_STATUS,'RVW',1,0),,'','f08_' || ROWNUM)
APEX_ITEM.HIDDEN(11,DECODE(CHF_STATUS,'PRD',1,0),,'','f11_' || ROWNUM)so that the values are 0/1?
Also, you have
DECODE (CHF_STATUS,'DEV',ROWNUM)instead of
DECODE (CHF_STATUS,'DEV',0,1)in the checkboxes, as I would expect.
I'm also not sure why you need to duplicate the checkboxes (f07,f10,f13) as hidden items (f05, f08, f11) if they are both 0/1 values. -
Exception while ADF SDO in a BPEL Process .Please help
I am following "getting hands on with 11 G" and having the following issues:
Non Recoverable System Fault :
<bpelFault><faultType>0</faultType><entityInternalNestedError xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>com.oracle.bpel.client.BPELFault: faultName: {{http://schemas.oracle.com/bpel/extension}bindingFault} parts: {{ summary=<summary> for CustomerApp_JBOServiceRegistry.</summary> ,detail=<detail>Could not find registry for CustomerApp_JBOServiceRegistry.</detail> ,code=<code>null</code>} </summary></part></entityInternalNestedError></bpelFault>
I have followed Chapter 18 of the turtorial.I have created an SDO object against a table in my database. The SDO object is accessed using the service interface from within a BPEL process.I have deployed the BPEL and SDO Application to a remote server.
The CustomerSDOService application works fine when tested independently.
I have associated an entity variable with the CustomerSDOService to hold the reference to the data. The error is happening on the Bind activity where in the primary key is bound with the input value to retreive a row.
Please help me out with the issue if anyone is aware of it.I am getting the same error...when I created engine and directory service, i got a sql script which I executed in engine and directory service schema..
worked fine...is there any i need to do extra...i am getting this error....need to solve this out ASAP..Gurus please help !!!
Edited by: user12053514 on Oct 15, 2009 6:31 AM -
Please help C++ into java.
Hello,
I am working one small swing program. And want to know about c++ code. Can any one tell me that can we convert the c++ code into java code. My c++ code is:
void Activity::computeInternalStructure(Rules& r)
//the internal subgroups list must be computed before entering here.
//teachers
//this->nTeachers=0;
this->iTeachersList.clear();
for(QStringList::Iterator it=this->teachersNames.begin(); it!=this->teachersNames.end(); it++){
int tmp;
for(tmp=0; tmp<r.nInternalTeachers; tmp++){
if(r.internalTeachersList[tmp]->name == (*it))
break;
assert(tmp < r.nInternalTeachers);
//assert(this->nTeachers<MAX_TEACHERS_PER_ACTIVITY);
//this->teachers[this->nTeachers++]=tmp;
this->iTeachersList.append(tmp);
//subjects
this->subjectIndex = r.searchSubject(this->subjectName);
assert(this->subjectIndex>=0);
//activity tags
this->iActivityTagsSet.clear();
foreach(QString tag, this->activityTagsNames)
assert(tag!="");
int index=r.searchActivityTag(tag);
assert(index>=0);
this->iActivityTagsSet.insert(index);
//this->activityTagIndex = r.searchActivityTag(this->activityTagName);
//students
//this->nSubgroups=0;
this->iSubgroupsList.clear();
for(QStringList::Iterator it=this->studentsNames.begin(); it!=this->studentsNames.end(); it++){
StudentsSet* ss=r.searchAugmentedStudentsSet(*it);
assert(ss);
if(ss->type==STUDENTS_SUBGROUP){
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == ss->name)
break;*/
tmp=((StudentsSubgroup*)ss)->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
cout<<qPrintable(s)<<endl;
else
this->iSubgroupsList.append(tmp);
//this->subgroups[this->nSubgroups++]=tmp;
else if(ss->type==STUDENTS_GROUP){
StudentsGroup* stg=(StudentsGroup*)ss;
for(int k=0; k<stg->subgroupsList.size(); k++){
StudentsSubgroup* sts=stg->subgroupsList[k];
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == sts->name)
break;*/
tmp=sts->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
cout<<qPrintable(s)<<endl;
else
//this->subgroups[this->nSubgroups++]=tmp;
this->iSubgroupsList.append(tmp);
else if(ss->type==STUDENTS_YEAR){
StudentsYear* sty=(StudentsYear*)ss;
for(int k=0; k<sty->groupsList.size(); k++){
StudentsGroup* stg=sty->groupsList[k];
for(int l=0; l<stg->subgroupsList.size(); l++){
StudentsSubgroup* sts=stg->subgroupsList[l];
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == sts->name)
break;*/
tmp=sts->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
QObject::tr("&Ok"));
cout<<qPrintable(s)<<endl;
else{
//this->subgroups[this->nSubgroups++]=tmp;
this->iSubgroupsList.append(tmp);
else
assert(0);
}Please help me. In this code we are using some variables. with QT GUI in c++.
Thanks in advance.
Manveer.Manveer-Singh wrote:
Hello,
I am working one small swing program. And want to know about c++ code. Can any one tell me that can we convert the c++ code into java code. My c++ code is:
void Activity::computeInternalStructure(Rules& r)
//the internal subgroups list must be computed before entering here.
//teachers
//this->nTeachers=0;
this->iTeachersList.clear();
for(QStringList::Iterator it=this->teachersNames.begin(); it!=this->teachersNames.end(); it++){
int tmp;
for(tmp=0; tmp<r.nInternalTeachers; tmp++){
if(r.internalTeachersList[tmp]->name == (*it))
break;
assert(tmp < r.nInternalTeachers);
//assert(this->nTeachers<MAX_TEACHERS_PER_ACTIVITY);
//this->teachers[this->nTeachers++]=tmp;
this->iTeachersList.append(tmp);
//subjects
this->subjectIndex = r.searchSubject(this->subjectName);
assert(this->subjectIndex>=0);
//activity tags
this->iActivityTagsSet.clear();
foreach(QString tag, this->activityTagsNames)
assert(tag!="");
int index=r.searchActivityTag(tag);
assert(index>=0);
this->iActivityTagsSet.insert(index);
//this->activityTagIndex = r.searchActivityTag(this->activityTagName);
//students
//this->nSubgroups=0;
this->iSubgroupsList.clear();
for(QStringList::Iterator it=this->studentsNames.begin(); it!=this->studentsNames.end(); it++){
StudentsSet* ss=r.searchAugmentedStudentsSet(*it);
assert(ss);
if(ss->type==STUDENTS_SUBGROUP){
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == ss->name)
break;*/
tmp=((StudentsSubgroup*)ss)->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
cout<<qPrintable(s)<<endl;
else
this->iSubgroupsList.append(tmp);
//this->subgroups[this->nSubgroups++]=tmp;
else if(ss->type==STUDENTS_GROUP){
StudentsGroup* stg=(StudentsGroup*)ss;
for(int k=0; k<stg->subgroupsList.size(); k++){
StudentsSubgroup* sts=stg->subgroupsList[k];
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == sts->name)
break;*/
tmp=sts->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
cout<<qPrintable(s)<<endl;
else
//this->subgroups[this->nSubgroups++]=tmp;
this->iSubgroupsList.append(tmp);
else if(ss->type==STUDENTS_YEAR){
StudentsYear* sty=(StudentsYear*)ss;
for(int k=0; k<sty->groupsList.size(); k++){
StudentsGroup* stg=sty->groupsList[k];
for(int l=0; l<stg->subgroupsList.size(); l++){
StudentsSubgroup* sts=stg->subgroupsList[l];
int tmp;
/*for(tmp=0; tmp<r.nInternalSubgroups; tmp++)
if(r.internalSubgroupsList[tmp]->name == sts->name)
break;*/
tmp=sts->indexInInternalSubgroupsList;
assert(tmp>=0);
assert(tmp<r.nInternalSubgroups);
//assert(this->nSubgroups<MAX_SUBGROUPS_PER_ACTIVITY);
bool duplicate=false;
if(this->iSubgroupsList.contains(tmp))
//for(int j=0; j<this->nSubgroups; j++)
// if(this->subgroups[j]==tmp)
duplicate=true;
if(duplicate){
QString s;
s=QObject::tr(QString("Warning: activity with id=%1\ncontains duplicated subgroups. Automatically correcting..."))
.arg(this->id);
QObject::tr("&Ok"));
cout<<qPrintable(s)<<endl;
else{
//this->subgroups[this->nSubgroups++]=tmp;
this->iSubgroupsList.append(tmp);
else
assert(0);
}Please help me. In this code we are using some variables. with QT GUI in c++.
Thanks in advance.
Manveer.why do you say this?
My c++ code is:and
In this code we are using some variables. with QT GUI in c++. You didn't code that. Liviu Lalescu code that, not you.
He has rights on that code and he published it under gpl.
So you must say that it is from him, not from you.
Also if you "translate" (modify) his algorithm you must still care about the gpl. Please read whole gpl and care about that.
Regards,
Volker Dirr
PS:
compare original code from Liviu at sourceforge or at his homepage:
http://lalescu.ro/liviu/fet/
you can see the copied copy in /src/engine/activity.cpp line 167 and following. -
PLEASE HELP, My Real media Movies always stutter.
PLease if any one can help. My product is finished,
and on my pentium 4 it works great. But when ever any one with a
lesser procesor uses it the Compressed real Player movies stutter
and even stop at some points. they all work effrtless in a Real
Player movie player outside of a director movie. So it is director
that some how slows them down. Has this happened to any one else?
can some one please help me find the answer.
thank you,
G.The problem is that your digital video files are compressed
with too
high a data rate. The higher the data rate the more work the
processor
has to perform. You may also find that a data rate that is
too high will
cause playback problems on slower CD readers.
I don't use real media, so I can't give you any information
on how to
compress your files so that they will work.
Rob
Rob Dillon
Adobe Community Expert
http://www.ddg-designs.com
412-243-9119
http://www.macromedia.com/software/trial/ -
IPhone unplugged during Restore Process, PLEASE HELP Restore!
Hi guys,
I was Restoring my original iPhone through iTunes and during this process my brother unplugged
the iphone from iTunes.
Now, I've been trying to restore again but the iTunes has prompted a little window that says
"Waiting for iPhone". I left it plugged in all night with iTunes on my Mac but it's stuck on that same
message.
Can someone please help me with this issue?
Thanks so much,
ZTry placing your iPhone in recovery mode.
Turn off your iPhone by holding the "Sleep/Wake" button for about five seconds and then sliding the red slider. If your iPhone is already off, there's no need to turn it on and then off again.
Once it's turned off, press and hold the "Home" button and plug the iPhone into your Mac.Keep holding the "Home" button until you see a dock cable pointing to the iTunes icon. iPhones running older software will display a yellow triangle and text which says "Please Connect to iTunes". You can now release the Home button.
Open iTunes (if it's not already open) and you will be told that "iTunes has detected an iPhone in recovery mode". Click "OK" and you will be taken to the iPhone pane. Click restore. -
HT5012 My iphone 5c was very slow processing,please help me?
My iphone 5c was very slow processing and my setting not working properly please help me
And my iphone 5c apps was crashing again and again..Try > http://support.apple.com/kb/TS1538
-
HT1386 my i phone 4s dead while update in process , please help
my i phone 4s dead while update in process , please help
You apparently aren't listening or don't understand English well enough to understand the responses you're getting.
An unlocked iPhone will remain unlocked. Updating a legitimately unlocked phone does NOT affect the locked/unlocked status.
It will only lock IF the phone was hacked or jailbroken to unlock it. -
take long to sync contacts and notes calandario 6800 and with Microsoft Outlook
already have 2 hours and not finish the process please helpWhere error messages are you getting?
Can you not do both? Send and Receive?
Check but I think yo have the right setting described here:
iCloud: Mail server information -
PLEASE HELP - unreported exception java.sql.SQLException
Basically create a database where Time is a field where its automatic enters date and time so no records need to be entered. and the Amount is when the user clicks on a button that amount is stored..basically how do i insert just the amount field
heres a snippet of the code..
CarParkDB db=new CarParkDB();
db.DBConnection();
String sql="insert into Stats (Time, Amount)"+
"values ('"+null+"','"+amount+"')";
db.s.executeQuery(sql); // executing the sq
Please kindly help me..thank youDont understand or know what the SQL is. The code is
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sourceURL =
"jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=CarPark.mdb;";
Connection CarPark =
DriverManager.getConnection(sourceURL, "admin", "");
Statement myStatement = CarPark.createStatement();
String writeString =
"insert into Stats(Amount) values("+(payment / 100.0)+")";
myStatement.executeUpdate(writeString);
ResultSet results = myStatement.executeQuery
("SELECT Amount, Time");
while (results.next()) {
System.out.print(results.getString(1) + " ");
System.out.print(results.getString(2) + " ");
System.out.println(results.getString(3));
results.close();
Error is: java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
I have two colums in the db - Time & amount. The time is updated, but the amount is not. -
AS IS process please help to map
Dear Guru's
My client have this AS IS process for there raw material and I want to map it in SAP QM.
Can any body help me to solve this with the step of Qm.
1. SECURITY DEPTT. INFORMS Q.A. REGARDING RECEIPT OF R/M.THROUGH REGISTER WHICH CONSIST OF SL. NO., VEHICLE NO. , DATE, CHALLAN NO., CHALLAN DATE, PARTY NAME, GATE ENTRY STAMP, NAME OF MATERIAL, IN TIME , SIGNATURE (WITH TIME ) STORE / QC PERSON , REMARKS.
2. Q.A. PREPARES COMPOSITE SAMPLE MANUALLY FOR TESTING.
3. Q.A. ANALYSES THE COMPOSITE SAMPLE FOR ALL ESSENTIAL PARAMETERS
4 IF MATERIAL PASSESS ALL ESSENTIAL TESTS, Q.A. TAKES A DECISION TO ACCEPT THE MATERIAL. Q.A. INFORMS STORE DEPARTMENT FOR UNLOADING THE MATERIAL AND RELEASE THE VEHICLE FOR WEIGHMENT/UNLOADING.
Please suggest me and help me come out from this
Thanks & Regards,
Nilesh IthapeHi,
1) Activate inspection type 01 in the inspection setup of QM view.
2) Create Quality plan for that
Assign all required parameters( characteristics) to be inspected .
3) Do migo for the required purchaes order
A lot will be generated in QA32 with lot orign 01
do result recording and usage decision .
Amol -
Can Someone Please Help With A Java App.
A while back, I had a program that I was working on, while taking Java in a Web Design & Development course -- this was back in 1999 -- not having the mindset of a programmer I failed that part of the course misrably. I had to do the following program, but you can see why I failed, I only managed to write to lines of code. I am wondering if there is anyone who can write it to the following criteria, maybe even make it graphical...I am hoping to try and write an XML backend to it like I wanted to do in 1999; unfortunately I lost the code that someone was nice enought to supply after I failed that part of the 6 month course...so if anyone can help please let me know. I want to try learning Java again, but it would be cool to see the following in working order again. If you're wondering why I still have the following, I just found it again while going through my Experts Exchange postings.
import java.awt.*;
public class CourseMarks extends Applet {
Of course I think this is wrong, but here is what I need done:
Define a class (data structure) to represent the people taking a course. For each person, you should record their name, their mid-term mark, their final mark, and any other information you think is relevant (hint: how do you find all the people in the class?)
A) The Applet/Program must be called CourseMarks
B) Write the class in Java
C) Create a variable called courseList to record students of a specific course, then write code to initialise it with information about three students.
D) Letter grades are to be awarded to the people taking the course, and you have to write a method to translate the final mark to a letter grade for each person. Letter grades are awarded as follows: 0-49.99 = F, 50-59.99 = E, 60-69.99 = D, 70-79.99 = C, 80-89.99 = B, 90-94.99 = A, 95 and up = A+. Write a method in Java and show how you would invoke it on courseList
E) Write a method to compute the class average for the mid-term mark (hint: follow your links), and show how you would invoke it on courseList.
Thanks,
Michael Lauzon, Founder
The Quill Society
http://www.quillsociety.org/
[email protected]Here is a quick and dirty implementation. I think I have everything in there. :-) import java.util.*;
public class CourseMarks {
private ArrayList courseList = null;
/** Constructor for class */
public CourseMarks() {
/** Populate course list with students */
private void initList() {
Student s1 = new Student( "Gweedo", 100.0, 100.0, 101 );
Student s2 = new Student( "Sally", 70.4, 65.3, 101 );
Student s3 = new Student( "Michael", 56.0, 45.0, 101 );
courseList = new ArrayList();
courseList.add( s1 );
courseList.add( s2 );
courseList.add( s3 );
/** Returns the list of students */
public ArrayList getCourseList() {
return courseList;
/** Compute and return the letter grade for the passed mark */
public String computeLetterGrade( double mark ) {
String grade = null;
if( mark <= 49.99 ) {
grade = "F";
} else if( mark >= 50.0 && mark <= 59.99 ) {
grade = "E";
} else if( mark >= 60.0 && mark <= 69.99 ) {
grade = "D";
} else if( mark >= 70.0 && mark <= 79.99 ) {
grade = "C";
} else if( mark >= 80.0 && mark <= 89.99 ) {
grade = "B";
} else if( mark >= 90.0 && mark <= 94.99 ) {
grade = "A";
} else if( mark >= 95 ) {
grade = "A+";
return grade;
/** Print out the letter grades for all the students in the passed list */
public void printLetterGrades( ArrayList studentList ) {
if( studentList != null && studentList.size() > 0 ) {
Student aStudent = null;
Iterator it = studentList.iterator();
while( it.hasNext() ) {
aStudent = (Student)it.next();
System.out.println( aStudent.name + " had final mark " + aStudent.finalMark +
" and letter grade " + this.computeLetterGrade( aStudent.finalMark ) + "." );
/** Compute the average mid term for the students in the passed list */
public double computeAverageMidTerm( ArrayList studentList ) {
double average = 0.0;
if( studentList != null && studentList.size() > 0 ) {
double total = 0.0;
Student aStudent = null;
Iterator it = studentList.iterator();
while( it.hasNext() ) {
aStudent = (Student)it.next();
total += aStudent.midMark;
average = total / studentList.size();
return average;
/** Main method so this class can be run */
public static void main(String[] args) {
CourseMarks app = new CourseMarks(); // Create new CourseMarks instance
app.initList(); // Init it's list of students
app.printLetterGrades( app.getCourseList() ); // Print letter grades for all students
System.out.println( "Average mid term: " + app.computeAverageMidTerm( app.getCourseList() ));
System.exit(0);
/** Simple class that just holds a few values */
class Student {
public String name = null;
public double midMark = 0.0d;
public double finalMark = 0.0d;
public int classNum = 0;
public Student( String aName, double aMidTerm, double aFinal, int aClassNum ) {
name = aName;
midMark = aMidTerm;
finalMark = aMidTerm;
classNum = aClassNum;
} -
HT4592 Please help identify proper Java update
I am trying to upload photos to an outside vender and it requires JAVA (which I must not have the latest version of because the site directed me to install it). I am using Mac OS X version10.5.8. If I choose About Java Preferences it says I have Java 6 Standard Edition version 12.9.0. Please tell me how to find the correct update. Thanks so much for your assistance.
The final Java update for Leopard was Update 10, 29 June 2011 - This release updates J2SE 5.0 to 1.5.0_30, and updates Java SE 6 to 1.6.0_26. J2SE 1.4.2 is no longer being updated to fix bugs or security issues and remains disabled by default in this update. Support for out-of-process Java applets on Mac OS X 10.5 Leopard has been removed with this update.
This release is only for Mac OS X 10.5.8 or later versions of Mac OS X 10.5. http://support.apple.com/kb/DL1359 -
Please help me on java Logger......
Hi,
can anyone give me a good tutorial link on java Logger?
one more doubt,
In logging, in the log file the info is saved in XML format.
How can i change it to normal text format?
pls help.....
-Soni.Hi,
I guess, there is one tutorial for logger in java site...if not, try log4j tutorial of apache...both are the same. As for as ur question is concerned - if you dont specify a log formatter, java loads the default formatter from $JAVA_HOME/jre/lib/logging.properties
If you check there, by default you will have
java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
u can change it to java.util.logging.SimpleFormatter
if you go through that properties file, i think it would be more than sufficient than beating the bush for tutorials. ;-)
Maybe you are looking for
-
Exception occured during processing of a Web Dynpro application
Hi, When I deploy the WD application on to the WAS Engine 6.40, am getting message Dployed succefully. But when I run the application am getting the following message in trace file. <b>The requested deployable object 'local/<componentname>' and appli
-
Not able to pass a date in send mail utility.
Hi, The requirement is : when some one is getting terminated in HR, send a mail to a fixed set of people. I created a trigger on Insert. Passing the person_id and calling a conc program. The IN to the conc program is person id. Now in the pkg I am us
-
Drag-and-drop no longer working in FF
All drag-and-drop features stopped working on my FF 21. That is, I can no longer: - Drag items to bookmarks or rearrange the bookmarks - Drag words to the search box or links to the URL box - Change the order of tabs - Rearrange items on toolbars - M
-
Using external display as main display-how?
My subject line says it all. I want to use an external LCD display as my main display while keeping my MacBook Pro closed w/o powering down to sleep. I know this can be done because I've seen posts where other users do it, but I've never learned how
-
Signature in Mail for Exchange
I recently updatet the firmware at my Nokia N73 to latest version (V 4.0839.42.2.1) which forced me to reinstall Mail for Exchange. After this update (Mail for Exchange ver. 2.07.000) I am only able to use a signature in outgoing mails limited to 75