How to get mysql error as a message on java
hi,
can any one please tell me how we can get the error generated by Mysql database during runtime as a message on a java program form.
thanks
try
aSQLMethod();//this method is capable of throwing an SQLException
catch(SQLException exc)
String errorMessage=exc.getMessagae();//I don't understand what you want to do with this error message
}
Similar Messages
-
Hello All,
I am using this API for creating a contact for an employee in R12.
But, some times i am not able to create the contact successfully, and Unable to figure out proper reason for record erroring out.
I dont find any out msg data variables for this API in order to check it for the Error.
So, can any body help me how to get the ERROR Message for such APIs.
Thanks inAdvance,
Amarnadh Jsuser12243334 wrote:
solved the issue on myselfIt would be nice if you could share the solution with us.
Thanks,
Hussein -
I am having trouble setting up my Yahoo! e-mail account on my phone...it asks for my Password and I type it in carefully and correctly, but I get an error window, "MF Message Error Domain error 1032" -what does this mean and how can I get around it? My password is long and convoluted, but it works when I type it in on my main Mac workstation, just fine.....what gives?
try restarting the phone and try again
-
I am getting an error 150::30 message - what do I need to do to correct?
When I try to edit a photo I started getting an error 150:30 message. How do I fix this problem?
PLease share more details about version you are using, OS and computer configuration.
It will be helpful if you can share the workflow steps you follow... -
I'm getting an error code -69 message
My iTunes library will not save and I get the error code -69 message pop up. This has started happening since the latest iTunes update was installed.
Hi malc389,
Welcome to the Support Communities!
The article below may be able to help you with this issue.
Click on the link to see more details and screenshots.
iTunes displays a -69 error when syncing iPod
http://support.apple.com/kb/HT1210
Cheers,
- Judy -
please let me know how to get past error msg 11 when trying to restore an ipod touch 4th gen
Is the iPod jailbroken? Googling shows that error 11 appears if it has been jailbroken.
-
How to get an error icon with tool tip in a displaying table in a particu
How to get an error icon with tool tip in a displaying table in a particular field..
Thanks.Hi,
In the context create an attribute of type string .
Create the attribute in the node which you bind for table.
In the layout .
1.create a Table UI element.
2 create binding for UI element.
3Right click on the Table UI and select insert table column.
4.once the table column is inserted right click on table column and select insert cell editor.
5.create the cell editor of the type image.
6.Bind the source property of the image to the attribute in the node which you have created.
so depending on what image(type of icon) needs to be displayed set the attibute accordingly.
refer to the link for image :
[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm]
Priya -
How to get the today's julian date in java?
how to get the today's julian date in java?
hi can any one tell me how to get the todays julian date using Calender class or GregorianCalender class....
Julian date for 2006.November.01 AD 05:54 PM : 2454041.0
i have tryied with
calJ.setGregorianChange(new Date(Long.MAX_VALUE));
System.out.println(sdf2.format(calJ.getGregorianChange()));
thanks
Tushar
Message was edited by:
lad_tusharthanks a lot....for intrest....
I have found some details about the Julian calendar as follows:
The Julian date for 2006: JAN: 01:12:01:59 is 2453737.00138
245 represent the year digits for year 2006
3737 represent the date fir 1 Jan
.00138 represents the time for 12:01:59
Julian date change as per every day 12 noon it increase one digit in it.
As per ref from
http://www.aavso.org/observing/aids/jdcalendar.shtml
Also chk this calendar where Julian date is 20. October 2006 for 02 November 2006
As per ref from
http://www.calendar.sk/julian_calendar-en.php
I have tried the pure �GregorianCalendar� class from jdk1.4 API and its setGregorianChange method but not getting as per the expected Julian date format. Using the �setGregorianChange()� i have setting the cutover date to Long.MAX_VALUE it means GregorianCalendar now have to act as per the Julian calendar ...so after setting the cutover date it return me changed date using �getGregorianChange()� but that was not the Julian date of the current date...as expected or as per above both scenario. Even though the last two digits are nowhere equal to the actual Julian date.
Program
GregorianCalendar cal = new GregorianCalendar();
cal.setGregorianChange(new Date(Long.MAX_VALUE)); // setting the calendar to act as a pure Julian calendar.
// cal.set(Calendar.DATE, new Date().getDate()); // seting the current date
// Date todayJD = cal.getGregorianChange(); // getting the changed date after the setGregorianChange
Date todayJD = cal.getTime(); // getting the calculated time of today�s Julian date
SimpleDateFormat sdfJulianDate = new SimpleDateFormat("yyDDD");
SimpleDateFormat sdfJuliandayOfYear = new SimpleDateFormat("DDD");
System.out.println("today Date = " + new Date());
System.out.println("Today as julian date = " + sdfJulianDate.format(todayJD));
System.out.println("Today as day of year = " + sdfJuliandayOfYear.format(todayJD));
OUTPUT:
USING : Date todayJD = cal.getGregorianChange();
Today Date = Thu Nov 02 15:17:05 IST 2006
Today as julian date = 94229
Today as day of year = 229
USING : cal.set(Calendar.DATE, new Date().getDate());
Today Date = Thu Nov 02 15:19:22 IST 2006
Today as julian date = 06319
Today as day of year = 319
USING : Date todayJD = cal.getTime();
Today Date = Thu Nov 02 15:17:59 IST 2006
Today as julian date = 06306
Today as day of year = 306
There is one another concept i found to get the Julian day of the year as per the Julian day chart mention on nasa site (http://angler.larc.nasa.gov/armsgp/JulianDayChart.html) and i m getting the moth of the year that is 306 for nov 02 2006 using getTime() method in above code then the out put is right for Julian day. But it was not as per the expected Julian date format. So in conclusion we can only able to retrieve the day of year for the Julian calendar. hope their will be a solution for this problem in java api ....else we allways have to depend upon the third party api that was not accepteble some times.....
Kindly chk chart on the site
http://angler.larc.nasa.gov/armsgp/JulianDayChart.html
http://weather.uwaterloo.ca/julian.html
http://www.fs.fed.us/raws/book/julian.shtml
Thanks,
Tushar Lad -
How to get check value in DB based on java
hi,
anybody know how to get check value in DB based on java?
TQThis should be a custom java class containing that method.
Try on java or jdbc forum - Java Database Connectivity (JDBC) , Java Programming -
Java - Axis2: How to get an error code / error message from the Javascript via SOAP
Hi
In our Java applicsation we call a Javascript in a Indesign CS Server using the following code:
--- SNIP BEGIN ---
// calls the remote service on the indesign server
try {
// create service
ServiceStub oIndsgnSrvStub = new
ServiceStub(sIndesignServer);
// create service parameter
ServiceStub.RunScriptParameters
oIndsgnSrvRSParams = new ServiceStub.RunScriptParameters();
// create arguments with source- and target-file for parameter
ServiceStub.IDSPScriptArg[] oIndsgnSrvSArgs = new ServiceStub.IDSPScriptArg[2];
oIndsgnSrvSArgs[0] = new
ServiceStub.IDSPScriptArg();
oIndsgnSrvSArgs[0].setName("xml-input");
oIndsgnSrvSArgs[0].setValue(sSourceFile);
oIndsgnSrvSArgs[1] = new
ServiceStub.IDSPScriptArg();
oIndsgnSrvSArgs[1].setName("output-file");
oIndsgnSrvSArgs[1].setValue(sTargetFile);
// define service parameter
oIndsgnSrvRSParams.setScriptArgs(oIndsgnSrvSArgs);
oIndsgnSrvRSParams.setScriptFile(sScriptFile);
oIndsgnSrvRSParams.setScriptLanguage("javascript");
oIndsgnSrvRSParams.setScriptText("");
// create runscript
ServiceStub.RunScript oIndsgnSrvRS = new ServiceStub.RunScript();
// set parameter
oIndsgnSrvRS.setRunScriptParameters(oIndsgnSrvRSParams);
//$$$ there should be an answer returned by the InddSrvr
// execute SOAP call
ServiceStub.RunScriptResult oIndsgnSrvRes = oIndsgnSrvStub.RunScript(oIndsgnSrvRS);
if(oIndsgnSrvRes.getErrorNumber() == 0) {
oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_SUCCESS);
bOK = true;
} else {
oServerProdJob.setProdState(CBP_Constant.REMOTEPRODUCTIONSTATE_FAILURE);
bOK = false;
//$$$ should be set, if there is something returned by inddsrvr
//oServerProdJob.setErrorMsg(sErrorMsg);
} catch(Exception e) {
sError += e.getMessage() + "\n";
bOK = false;
--- SNIP END -----
The problem is that we don't get the error code and/or the error message from the Javascript in oIndsgnSrvRes. The error code is always 0 if I set an Integer value as return in the Javascript. If I set a String, there is an Exception in the Java application.
Here is the Java script we use:
--- SNIP BEGIN ---
main();
main()
var sError = "";
var sXMLInput = "";
var sLayoutPath = "";
// get the SDKCodeSnippetRunner object
var cbpAdapter = app.cbpCbpadapterObject
if (cbpAdapter) {
sXMLInput=app.scriptArgs.get("xml-input");
sLayoutOutputFile=app.scriptArgs.get("output-file");
sError = cbpAdapter.doProcess(sXMLInput, sLayoutOutputFile);
return sError; // This give an Exception; if I return an Integer the ScriptResult is always 0
--- SNIP END -----
If I try this with the test application from Adobe I get the error code correctly. But in the Java application, using SOAP, I can't get the error code.
What could be wrong?
Any ideas?
Thanks a lot for the support.
Kind regards
Hansuser11340104 wrote:
Hello -
i am calling sqlplus from a bash shell script. If the sql statement generates an error, how can I return that error code (unsuccessful) back to the bash shell?
Well, let google be your friend,
http://www.google.co.in/search?rlz=1C1GGLS_enIN327IN327&sourceid=chrome&ie=UTF-8&q=sqlplus+error+codes
There are many threads I guess talking about the same issue.
HTH
Aman.... -
How to get actual error messages
I use a call transction method if there is any error capture it to an internal table of
type bdcmsgcoll..
But here it gives me just batch parameters and other fields along with a message number..susing this message number how do i get the actual SAP genrated message(text message)..ther must be some function module which will give accept these parameters and give out hte actual message...Hi,
You can get the actual error message by using the FM <b>FORMAT_MESSAGE</b>.
Lets suppose that you got error messages into t_msg internal table...
loop at t_msg into x_msg.
call function 'FORMAT_MESSAGE'
exporting
id = x_msg-msgid
lang = sy-langu
no = x_msg-msgnr
V1 = x_msg-MSGV1
V2 = x_msg-MSGV2
V3 = x_msg-MSGV3
V4 = x_msg-MSGV4
importing
msg = v_msgstr
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
write:/ v_msgstr.
endloop.
Here, the variable <b>v_msgstr</b> will be having the actual error message...
Hope it helps.
Regards,
Phani.
Message was edited by:
Sivapuram Phani Kumar -
I used to be able to go to a website and click their print button and it would print just fine. The only programs I will always update when they are available are Firefox, Avast Free Anti virus, and Malwarebytes. I think I may have updated Java too but it was after my printing problem began. I have the latest printer driver update installed which is the same version that I have been printing with before the error began. My printer is an Epson Stylus NX210 series All in One printer. My laptop is a Toshiba Satellite L650 series. I used to get the error message every time I tried to print a Michaels coupon but I was able to print from any other website I tried. Could someone please help me figure out what to do so I can start printing things again? Thank you!
If you are getting Siri when you double tap, then your home button must be sticking. Siri comes up when you hold the home button. Try tapping quickly twice. When that happens, the multi-tasking list comes up and you will see the app icon and then a thumbnail, or reduced size view of the app above it. You put your finger on that thumbnail and swipe upwards with your finger.
For that issue, you might want to do a reset of the phone. Hold the sleep/wake and home buttons together until you see the Apple logo and then release. The phone will reboot. This will not affect your data.
To be honest, your novel is a little difficult to read, and I think you put too much information in there, and a lot of it is unnecessary. Be to the point and just add information necessary to understand the issue. -
How to get actual error from Crystal Report
We are using Crystal report in web service.
We faced some problem due to crystal report unexpected error.
Refer the below error message.
Xception E NSF NSFZ1100 20100608 145511565 GPRAB0 : GPRZ10 GUEC0001 [1] AbstractService Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
Xception E NSF NSFZ1100 20100608 145511972 GPRAB0 : GPRZ10 GUEC0001 [1] AbstractService at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon)
at CrystalDecisions.Windows.Forms.CrystalReportViewer.HandleExceptionEvent(Object eventSource, Exception e, Boolean suppressMessage)
at CrystalDecisions.Windows.Forms.CrystalReportViewer.HandleExceptionEvent(Object eventSource, Exception e)
at CrystalDecisions.Windows.Forms.ReportDocumentBase.GetLastPageNumber()
at CrystalDecisions.Windows.Forms.ReportDocumentBase.GetLastPage()
at CrystalDecisions.Windows.Forms.DocumentControl.ShowLastPage()
at CrystalDecisions.Windows.Forms.PageView.ShowLastPage()
at Biz.Nissan.Cats.CORE.REPORT.LibCrystalReport.TotalPageCount(ReportDocument Rpt)
at Biz.Nissan.Cats.CORE.REPORT.LibCrystalReport.Print(BaseReport RptDefinition)
at Biz.Nissan.Cats.CORE.REPORT.MCTLIST260Print.Print(IFData ifData)
at Biz.Nissan.W3.CATS.BC.Service.DistributeService.ExecuteMpp()
How we get the actual error from crystal report?
Thanks in AdvanceSame as
crystal report unexpected error in Web service (IIS)
Closing this thread.
Ludek -
PO is getting created and getting an error in the Message tab ME23N
HI everybody,
I am uploading the data and creating the PO through BAPI, and the PO is getting created. when i logged into ME23N and checking the PO it is everything fine without any error.
But when i click on the message button and checking the display PO output is giving an error message over as Incorrectly processed and when i check the processing log i am seeing the msg text as error in the address output.
and i checked the NACE transaction the output type is configured with program name, form routine name, form name and smartform name.
here in the form name and the smartform name which is present is having the different name and both are the smartforms only.
Can any one help me out in this issue how to resolve the error.
Thanks in advanceHi,
Check the TNAPR Table by putting the Form Name / Program Name to find out the output type it is attached to.
Debug
The other method of checking is by setting up a break-point at smartform and manually entering a PO using the same upload data and try to save it. But this would not help you much. Because the root cause is the Determination of output type.
Thanks & Regards
Suresh Nair -
How to get ORA errors in alertlog file using shell script.
Hi,
Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
ThanksHi,
You can define the alert log as an external table, and extract messages with SQL, very cool:
http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
If you want to write a shell script to scan the alert log, see here:
http://www.rampant-books.com/book_2007_1_shell_scripting.htm
#!/bin/ksh
# log monitoring script
# report all errors (and specific warnings) in the alert log
# which have occurred since the date
# and time in last_alerttime_$ORACLE_SID.txt
# parameters:
# 1) ORACLE_SID
# 2) optional alert exclusion file [default = alert_logmon.excl]
# exclude file format:
# error_number error_number
# error_number ...
# i.e. a string of numbers with the ORA- and any leading zeroes that appear
# e.g. (NB the examples are NOT normally excluded)
# ORA-07552 ORA-08006 ORA-12819
# ORA-01555 ORA-07553
BASEDIR=$(dirname $0)
if [ $# -lt 1 ]; then
echo "usage: $(basename) ORACLE_SID [exclude file]"
exit -1
fi
export ORACLE_SID=$1
if [ ! -z "$2" ]; then
EXCLFILE=$2
else
EXCLFILE=$BASEDIR/alert_logmon.excl
fi
LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
if [ ! -f $EXCLFILE ]; then
echo "alert exclusion ($EXCLFILE) file not found!"
exit -1
fi
# establish alert file location
export ORAENV_ASK=NO
export PATH=$PATH:/usr/local/bin
. oraenv
DPATH=`sqlplus -s "/ as sysdba" <<!EOF
set pages 0
set lines 160
set verify off
set feedback off
select replace(value,'?','$ORACLE_HOME')
from v\\\$parameter
where name = 'background_dump_dest';
!EOF
`
if [ ! -d "$DPATH" ]; then
echo "Script Error - bdump path found as $DPATH"
exit -1
fi
ALOG=${DPATH}/alert_${ORACLE_SID}.log
# now create awk file
cat > $BASEDIR/awkfile.awk<<!EOF
BEGIN {
# first get excluded error list
excldata="";
while (getline < "$EXCLFILE" > 0)
{ excldata=excldata " " \$0; }
print excldata
# get time of last error
if (getline < "$LASTALERT" < 1)
{ olddate = "00000000 00:00:00" }
else
{ olddate=\$0; }
errct = 0; errfound = 0;
{ if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
{ # get next record from file
next; # get next record from file
# here we are now processing errors
OLDLINE=\$0; # store date, possibly of error, or else to be discarded
while (getline > 0)
{ if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
{ if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
OLDLINE = \$0; # no error, clear and start again
errfound = 0;
# save the date for next run
olddate = dtconv(\$3, \$2, \$5, \$4);
continue;
OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
{ # extract the error
errloc=index(\$0,"ORA-")
if (errloc > 0)
{ oraerr=substr(\$0,errloc);
if (index(oraerr,":") < 1)
{ oraloc2=index(oraerr," ") }
else
{ oraloc2=index(oraerr,":") }
oraloc2=oraloc2-1;
oraerr=substr(oraerr,1,oraloc2);
if (index(excldata,oraerr) < 1)
{ errfound = errfound +1; }
else # treat fuzzy as errors
{ errfound = errfound +1; }
END {
if (errfound > 0)
{ printf ("%s<BR>",OLDLINE); }
print olddate > "$LASTALERT";
function dtconv (dd, mon, yyyy, tim, sortdate) {
mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
if (mth < 1)
{ return "00000000 00:00:00" };
# now get month number - make to complete multiple of three and divide
mth=(mth+2)/3;
sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
return sortdate;
!EOF
ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
rm $LASTALERT
if [ $ERRCT -gt 1 ]; then
echo "$ERRCT Errors Found \n"
echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
exit 2
fi
Maybe you are looking for
-
I took my iPhone running today and when I returned I was not able to slide it open or type in my pass code. All buttons are still responding. I have tried restarting it multiple times and even restored it, but the touch screen will not respond to any
-
I have 3 numbers on my account, how do i access them from a PC?
I have multiple numbers on my one account. How do I access them from a PC? Im only seeing one of my numbers showing up, not all of them. Is there a tab or something where you can switch back and forth between numbers?
-
Problem with different browsers when I save pdf
Hi I have server side application which open some pdf form and populate it with values and some javascript(I use FDFToolkit to do that). A client connects with a browser to my server opens the form in the browser window and after that saves the form
-
What is the process of changing name of IT Resource Type without breaking..
I need to change the name of an IT Resource Type and at the same time include additional fields. I also have existing IT Resources that are provisioned that are of the old name. What I thought I could do was to use the Design Console, bring up the IT
-
Internal table with an internal table
Hi, I have following definition: TYPES: BEGIN OF ty_pos, numbertype(29) TYPE c, number(29) TYPE c, END OF ty_pos. DATA: gt_pos TYPE STANDARD TABLE OF ty_pos, gs_pos LIKE LINE OF