I'm working with some ASP code which I'm not really to familiar with. I need to convert/change the code below (original code) to Java (Which I'm no expert in)
I understand some of the syntax but I'm kind of stuck at the line of code beginning "On Error Resume Next" I don't know which function to use that Java uses.
This part is throwing me off ( Not sure what "Next" needs to be in Java )
any help would be appreciated
<% <!-- each string had DIM in front ex. DIM fEmptyRecordset So i believe I changed what was needed --->
<%
Boolean fEmptyRecordset = ""; ' as Boolean
Boolean fFirstPass = ""; ' as Boolean
Boolean fNeedRecordset = ""; ' as Boolean
Command cmdTemp = ""; ' as Command
Double dblUnits = ""; ' as Double
Double dblRateFrom = ""; ' as Double
Double dblRateTo = ""; ' as Double
Double newRate = ""; ' as Double
Double newUnits = ""; ' as Double
String NewCurrName = ""; ' as String
String NewCurrName2 = ""; ' as String
' Convert currency
fEmptyRecordset = true;
fFirstPass = true;
fNeedRecordset = true;
<!--- here is where I'm stuck, I don't quite understand the "On Error Resume Next" function that ASP uses. I'm just looking for gudance in which function this is related to in Java --->
On Error Resume Next
if (fNeedRecordset) {
Set con_currency_sdo = Server.CreateObject("ADODB.Connection")
con_currency_sdo.ConnectionTimeout = con_currency_sdo_ConnectionTimeout
con_currency_sdo.CommandTimeout = con_currency_sdo_CommandTimeout
con_currency_sdo.Open con_currency_sdo_ConnectionString, con_currency_sdo_RuntimeUserName, con_currency_sdo_RuntimePassword
Set cmdTemp = Server.CreateObject("ADODB.Command")
Set GetRate = Server.CreateObject("ADODB.Recordset")
' Find out what the common base currency is and get the corresponding rates for both
' the From and To currencies. Order desc to get USD, GBP, EUR. (USD is preferred)
cmdTemp.CommandText = "SELECT FROMCURR.BASE_CURR_CODE, " & _
"FROMCURR.CURR_RATE_BASE_FC FROMRATE, TOCURR.CURR_RATE_BASE_FC TORATE, " & _
"CURRNAMEFROM.BLMBG_CURR_NAME FROMCURRNAME, CURRNAMETO.BLMBG_CURR_NAME TOCURRNAME " & _
"FROM AON_CURR_DAILY_EXCH_RATE_SDO FROMCURR, AON_CURR_DAILY_EXCH_RATE_SDO TOCURR, " & _
"AON_CURRENCY_SDO CURRNAMEFROM, AON_CURRENCY_SDO CURRNAMETO " & _
"WHERE FROMCURR.CURR_CODE='" & Request.Form("selBaseCurr") & _
"' AND TOCURR.CURR_CODE='" & Request.Form("selTargetCurr") & _
"' AND FROMCURR.BASE_CURR_CODE=TOCURR.BASE_CURR_CODE" & _
" AND FROMCURR.CURR_CODE=CURRNAMEFROM.CURR_CODE" & _
" AND TOCURR.CURR_CODE=CURRNAMETO.CURR_CODE" & _
" AND FROMCURR.CURR_DATE='" & dateString & _
"' AND TOCURR.CURR_DATE='" & dateString & _
"' ORDER BY FROMCURR.BASE_CURR_CODE DESC;"
cmdTemp.CommandType = 1
Set cmdTemp.ActiveConnection = con_currency_sdo
GetRate.Open cmdTemp, , 0, 1
' Place all error codes in comments
if (Err.number <> 0) {
fEmptyRecordSet = true;
out.println("<!-- ADO Errors Begin -->" & "\r\n")
for (Object objError : con_currency_sdo.Errors) {
out.println("<!-- ADO Error.Number = " & objError.Number & "-->" & "\r\n")
out.println("<!-- ADO Error.Description = " & objError.Description & "-->" & "\r\n")
out.println("<!-- ADO Error.Source = " & objError.Source & "-->" & "\r\n")
out.println("<!-- ADO Error.SQLState = " & objError.SQLState & "-->" & "\r\n")
out.println("<!-- ADO Error.NativeError = " & objError.NativeError & "-->" & "\r\n")
Next <!--- Not sure what "Next" needs to be in Java --->
out.println("<!-- ADO Errors End -->" & "\r\n")
out.println("<!-- VBScript Errors Begin -->" & "\r\n")
out.println("<!-- Err.number = " & Err.number & "-->" & "\r\n")
out.println("<!-- Err.description = " & Err.description & "-->" & "\r\n")
out.println("<!-- Err.source = " & Err.source & "-->" & "\r\n")
out.println("<!-- VBScript Errors End -->" & "\r\n")
if (checkDate = true) {
%>