SAK }‘ŠÙ

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

ASP VB Script oo4o + SQL ‰ž—p•Ò2 oo4o Ú‘± - CreateDatabasePool

oo4o ‚ÍAOracle RDBMS ‚Å‚ÝŽg—p‰Â”\‚Å‚·B

¡global.asa ‚Å‚Ì oo4o Ú‘±

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
option explicit

Sub Application_OnStart

'** oo4o ƒIƒuƒWƒHƒNƒgì¬
  Set Application("OraSession") = Server.CreateObject("OracleInProcServer.XOraSession") 

End Sub

Sub Application_OnEnd

'** oo4o ƒIƒuƒWƒHƒNƒg”pŠü
  Set Application("OraSession") = Nothing

End Sub

Sub Session_OnStart

'** ƒZƒbƒVƒ‡ƒ“ƒ^ƒCƒ€ƒAƒEƒg
  Session.Timeout = 20

'** ƒXƒNƒŠƒvƒgƒ^ƒCƒ€ƒAƒEƒg
  Server.ScriptTimeout = 120

'** oo4o ƒZƒbƒVƒ‡ƒ“ì¬
  Set Session("OraDatabase") = Application("OraSession").DbOpenDatabase("", "SAK/SAK", 0)

End Sub 

Sub Session_OnEnd

'** oo4o ƒZƒbƒVƒ‡ƒ“”pŠü
  Set Session("OraDatabase") = Nothing

End Sub

</SCRIPT>

¡•â‘«

  Esession("OraSession") ‚ɂ‚¢‚Ä‚ÍAapplication("OraSession") ‚Ì•û‚Å
    ’è‹`‚µ‚Ä‚Ý‚½B

  E‚±‚Ì global.asa ‚Ì’è‹`‚ðŽg—p‚·‚é‚ÆAasp ‚Å‚ÍA
      application("OraSession")
      Session("OraDatabase")
    ‚ªŽg—p‚Å‚«‚éB

¡Ú‘±ƒv[ƒ‹‚ÌŽg—p

  EÚ‘±ƒv[ƒ‹Žg—p‚ÍA‹Œƒo[ƒWƒ‡ƒ“‚Ì oo4o ‚Å‚ÍŽ©‘O‚Å DLL ‚ð쬂·‚éB
    Å‹ß‚Ì oo4o ‚Å‚ÍACreateDatabasePool ‚È‚Ç‚ª•W€‚ÅŽg—p‚Å‚«‚éB

<OBJECT RUNAT=Server SCOPE=Application ID=OraSession
  PROGID="OracleInProcServer.XOraSession">
</OBJECT>
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
option explicit

Sub Application_OnStart

  const dbname = ""
  const cnuser = "SAK/SAK"

'** oo4o Ú‘±ƒv[ƒ‹ì¬
  OraSession.CreateDatabasePool 20, 100, 200, dbname, cnuser, 0
                               '|   |    |_ timeout seconds
                               '|   |_ max size
                               '|_ init size

End Sub

Sub Application_OnEnd

'** oo4o Ú‘±ƒv[ƒ‹”pŠü
  OraSession.DestroyDatabasePool

End Sub

Sub Session_OnStart

'** ƒZƒbƒVƒ‡ƒ“ƒ^ƒCƒ€ƒAƒEƒg
  Session.Timeout = 20

'** ƒXƒNƒŠƒvƒgƒ^ƒCƒ€ƒAƒEƒg
  Server.ScriptTimeout = 120

'** oo4o ƒZƒbƒVƒ‡ƒ“ì¬
  Set Session("OraDatabase") = OraSession.GetDatabaseFromPool(100)
                                                             '|_ wait time seconds

End Sub 

Sub Session_OnEnd

'** oo4o ƒZƒbƒVƒ‡ƒ“”pŠü
  Set Session("OraDatabase") = Nothing

End Sub

</SCRIPT>

¡XV—p“Á•ÊƒZƒbƒVƒ‡ƒ“‚ÌŽg—p

  EÚ‘±ƒv[ƒ‹‚ðŽg—p‚µ‚Ä‚ÌXV‚ÍA‚¢‚ë‚¢‚ë‚Æ–â‘肪‚ ‚é‚悤‚Å‚ ‚éB
    XV—p“Á•ÊƒZƒbƒVƒ‡ƒ“‚ň—‚·‚é‚Ì‚ª‘Ó–‚炵‚¢B

  const dbname = ""
  const cnuser = "SAK/SAK"

  Application.Lock
  Set oss = OraSession.Client.CreateSession("#" & Session.SessionID)
  Set odb = oss.OpenDatabase(dbname, cnuser, 0)
  Application.Unlock

  odb.BeginTrans

  odb.ExecuteSQL ...
  ... odb.Rollback

  odb.CommitTrans

  Application.Lock
  Set odb = Nothing
  Set oss = Nothing
  Application.Unlock

¡ASP VB Script oo4o + SQL ‰ž—p•ÒŽ‘—¿
¡ASP VB Script ADO + SQL ‰ž—p•ÒŽ‘—¿
¡ASP VB Script Šî‘bŽÀ’n•ÒŽ‘—¿
¡ASP VB Script Šî‘b•ÒŽ‘—¿
¡SQL Šî‘b•ÒŽ‘—¿
¡SQL Šî‘bŽÀ’n•ÒŽ‘—¿
¡SQL ƒ`ƒ…[ƒjƒ“ƒO•ÒŽ‘—¿
¡Oracle PL/SQL •ÒŽ‘—¿
¡PostgreSQL •ÒAJAVA ServletAJSP •ÒŽ‘—¿
¡MySQL •ÒŽ‘—¿
| VB | SQL | Perl | PHP | ASP | JSP | C | PC | HP | FAQ | ƒtƒŠ[ƒ\ƒtƒg |

SAK Streets ƒƒCƒ“ƒXƒgƒŠ[ƒg }‘ŠÙEƒJƒtƒF ˆê—— SAK Streets ŒŸõ



Copyright (C) 1999-2024 Y.SAK