java equivalent of ado components
[nobr]hi,
im posting for the first time,infact this is the first time i've joined a technical forum. My difficulty is that i just know basic java but have been asked to convert quite a few asp pages to jsp. im working it out but im in a fix. Can somebody tell me the equivalent java for the following snippet. Are recordset and resultset equivalent?
Function OpenConnection()
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open"DRIVER={SQL Server};SERVER=demodarshak;UID=gscas;PWD=GSCAS;DATABASE=gscas"
'cn.Open "DSN=gscas;UID=gscas;PWD=gscas;"
If cn.State = 0 Then
Response.Write"<BR><CENTER><b>ISO Management System.</b><BR><BR>"
Response.Write"<BR><CENTER><b>Database connectivity failed.</b><BR><BR>"
Response.Write"<BR><CENTER><b>Please Try Later.</b><BR><BR>"
Response.end
End If
End Function
Function CurrentDate()
set rsDate = server.CreateObject ("ADODB.recordset")
on error resume next
rsDate.Open"SELECT convert(varchar(12),getdate(),103) as CurrentD",cn
CurrentDate = rsDate.fields("CurrentD")
End Function
[/nobr]

