GuestAndrewCanyoupleaseprovideanexampleforcallingastoredprocedurethatdoesnotperformanyquery。

Forexample,astoredprocedurethatperformssomeupdatesandinsertanddoesnotreturnanything。

VoteUp14VoteDownReply1yearagoGuestDeepaksinghforevery。

list()callitwillreturnzerosizelist。

thatmeansitwillworkinbothcasew/oreturnfromprocedure。

VoteUp0VoteDownReply8monthsagoGuestSankarUsingQueryquery=session。

createSQLQueryforstoredprocedurecalltaking2minsfor125000records

VoteUp0VoteDownReply1monthagoGuestsriniHiMkyongcanyoutellmeabouthowtofetchparticularcolumnsinsteadofselect*

VoteUp0VoteDownReply2yearsagoGuestBillThanks!

VoteUp0VoteDownReply2yearsagoGuestSathanaSubramaniamItisnice。

Canyoupleaseexplainaboutoutputparams?

VoteUp0VoteDownReply2yearsagoGuestArpitShahwhataboutoutparameter

VoteUp0VoteDownReply2yearsagoGuestTarangZilpeIamusingsession。

createSqlQuery()。

Questionisquery。

list()willreturnaresultSet。

HowdoIclosethisresultSet?

Orisitthatsession。

close()willclosetheresultsetautomatically。

VoteUp0VoteDownReply4yearsagoGuestVikasKumarThnaksforthepost。

ItwasthrowingJDBCException。

Soichangedquery。

list()withquery。

executeUpdate()andnowitsworkingfine。

VoteUp0VoteDownReply4yearsagoGuestRachanaNavarkarIamusingORACLE11gasmydatabase。

AbovecoderunfinewithMYSQLdatabasebutwhatifamrunitwithORACLE11gDB。

ITgivesfollowingerror

ERROR:CannotperformfetchonaPLSQLstatement:next

Canyoupleasehelpmetogetthesolutionforthis。

VoteUp0VoteDownReply4yearsagoGuestAcmejavJaviHellomaster,couldyouhelpmeplease?

IhaveanerrrorinStockstock=(Stock)result。

get(i),sayscannotbecasttostock

VoteUp0VoteDownReply4yearsagoGuestArunHiMkyong,

howtogetOutputparameterMysqlStoreprocedureusingHibernate?

VoteUp0VoteDownReply5yearsagoGuestLemongrassTheexamplesaregood,butin1)thereisamistake:

Thecallshouldbelikethis:

SQLQueryquery=session。

createSQLQuery(。

);

IfyouusetheQueryclassyouwillnotbeabletouseaddEntityetc。

Bestregards

VoteUp0VoteDownReply5yearsagoGuestguitarIsTooExpensiveNope,SQLQueryInterfaceisaSubinterfaceofQueryInterface。

Theone-linerstatementgivenheredoeswork(amultiplestatementsolutionwouldnotbepossibleinsuchatransparentmanner,though)。

VoteUp0VoteDownReply5yearsagoGuestCyanideEXECisalsoPossible。

Example:EXEC*StoredProcedureName*:Param1:Param2:Param3

VoteUp0VoteDownReply5yearsagoGuestNiharikaSaxenaHi,CanyoupleasetellhowtocallaprocedureusinghibernatewhenwehavebothinandOUtparametrs

VoteUp0VoteDownReply5yearsagoGuestABHILASHJAINHowaboutifselectedcolumnisbeenqueriedinStoredProc,thenhowhibernatehandlesit。

withrespecttoxmlmapping

VoteUp0VoteDownReply6yearsagoGuestsapnaCanwecreateprocedurefromhibernate?

VoteUp0VoteDownReply6yearsagoGuestAlexeiItsverynice。

Butwhatifusingjpa2。

0andoraclestoredfunctionwith%rowtypeasresult?

(Ihaveaproblemandhavenotyetfoundasolution)

VoteUp0VoteDownReply6yearsagoGuestAvinashReddyCheerlaOraclefunctionreturntypesmustbepredefinedandnotuserdefined。

VoteUp1VoteDownReply5yearsagoGuesthirenpatelHi,

PleasegivemeExampleofcalloraclestorageprocedure(sp)usingHibernatewithstruts2

Thanks,

hirenpatel

VoteUp0VoteDownReply6yearsagoGuestJigarWhatiftherearemultiplecursors?

VoteUp0VoteDownReply6yearsagoGuestVarunJadhavCanyougiveanexampleforcallingStoredProcedureusingnamedquery。

ActuallyIwanttoknowhowtosetOUTparameterusingnamedquery。

VoteUp0VoteDownReply6yearsagoGuestQuangVinhHiall,Iwantcreatenamedquerytocallonestoredprocedureandonefunctionasbelow:Createorreplacesp_test(p_numINNUMBER(2),p_outOUTNUMBER(2))ISBEGINp_out:=p_num*10;END;-FUNCTIONFUNCTIONget_awardhis(p_member_idINNUMBER)RETURNmy_cursorISc_resultmy_cursor;v_sqlVARCHAR2(7000);BEGINv_sql:=SELECTTO_CHAR(rh。

bill_cycle,dd/mm/yyyy),rh。

reward_id,rh。

amount,rh。

usage_mark,rh。

serial,||rh。

status,to_char(rh。

create_date,dd/mm/yyyy),to_char(rh。

approve_date,dd/mm/yyyy),to_char(rh。

receive_date,dd/mm/yyyy)||FROMreward_historyrh||WHERErh。

member_id=:p_member_id||ORDERBYrh。

create_dateDESC;OPENc_resultFORv_sqlUSINGp_member_id;RETURNc_result;END;Pleasehelpmecallthemwithoutjava。

sql。

connection,onlyusehibernate。

…ReadmoreVoteUp0VoteDownReply6yearsagoGuestAndresHey,whatIdonotunderstandiswheredoyoustorethesqlcodesothatjavacancallit?

VoteUp0VoteDownReply6yearsagoGuestPvIhaveastoredprocedurewhichcontainsmultipleresults。

forexample,afterexecutingthestoredprocedureinSQL,Iwillgettwotablesemployee,Department。

HowcanIuseboththetablesusingHIBERNATEinmyGWTapplication?

Canyoupleaseprovideanexampleforthesame。

Thanks

Pratik

VoteUp0VoteDownReply6yearsagoGuestMartinBorruelyoucanimplementanunionforeasyhandle:)

VoteUp0VoteDownReply4yearsagoGuestjatinthanks

VoteUp0VoteDownReply7yearsagoGuestSagarDahagamwarHi,Ifoundabovetutorialveryuseful。

IveimplementedSPcallinsamemanner(usingannotation)asmentionedinabovetutorial。

Ivedeployedmyapplicationinwindows/weblogicapplicationserver(11g)。

AndthedatabaseIamusingisMSSQL。

OnwindowsmachineIamsuccessfulygettingtheresult,ButwhenIvedeployedapplicationonLinux/weblogicapplicationserver(11g)bycommunicatingwiththesamedatabase,Iamgettingbelowexceptionwhileexecutionofstoreprocedure。

[OWLS][SQLServerJDBCDriver][SQLServer]Incorrectsyntaxnear@P1。

Hereistheexactstacktrace。

Causedby:java。

sql。

SQLException:[OWLS][SQLServerJDBCDriver][SQLServer]Incorrectsyntaxnear@P1。

atweblogic。

jdbc。

base。

BaseExceptions。

createException(UnknownSource)atweblogic。

jdbc。

base。

BaseExceptions。

getException(UnknownSource)…ReadmoreVoteUp0VoteDownReply7yearsagoGuestMadanhi,thisismyoraclestoredprocedure

CREATEORREPLACEPROCEDUREsp_pos_pur_resp(

p_cursorOUTsys_refcursor,

hashed_panINVARCHAR2,

acc_typeINVARCHAR2,

trans_amtINNUMBER

AS

balNUMBER;

responseVARCHAR2(100);

BEGIN

reponse:=NULL;

bal:=0;

OPENp_cursorFOR

SELECTa。

current_balance

INTObal

FROMprod_accountsa,prod_cardc

WHEREc。

prod_card_id=a。

prod_card_id

ANDc。

prod_card_hased_pan=hashed_pan

ANDa。

primaryaccttype=acc_type;

bal:=bal–trans_amt;

IFbal0

THEN

response:=insufficientfund

ENDIF;

END;

herethisprocedurereturnsbalanceresponse。

responseisnotacolumnintable。

pleasetellmehowcan

iconfigurethatinthehbmfile?

alsohowshouldicallinthejava?

Thanksinadvance。

VoteUp0VoteDownReply7yearsagoGuestMilindDurugkarInsteadofusinghbmfileMapclassfileandannotedcolumnwith@TRANSIENTtobalcolumn。

VoteUp0VoteDownReply7yearsagoGuestVikasKumarItwasthrowingJDBCException。

Soichangedquery。

list()withquery。

executeUpdate()andnowitsworkingfine。

VoteUp0VoteDownReply4yearsagoGuestvijayaHi,

CouldyoupleasegiveanexamplehowtoinvokeSPwhichcontainsbothinsertandupdatequeriesinsamestoredprocedureandeitherinsertorupdatewilbeexecuteddependingupontheexistanceoftheRecordinDB。

Thanks

Vijaya

VoteUp0VoteDownReply9yearsagoGuestsapnaCanwecreateprocedurefromhibernate?

Pleasehelpme。

Thanksinadvance。

VoteUp0VoteDownReply6yearsagoHibernateTutorials|Tutorials[]HowtocallstoreprocedureinHibernateItsnotrecommendtoputbusinesslogicintostoreprocedure,nevermind,youstillallowtocallstoreprocedureinHibernate。

[]