扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:ern 来源:论坛 2007年11月8日
关键字: Windows
Dim onRemove As CacheItemRemovedCallback = Nothing onRemove = New CacheItemRemovedCallback(AddressOf RemovedCallback) |
PublicSub RemovedCallback(ByVal key AsString, ByVal value AsObject, ByVal reason As CacheItemRemovedReason) Dim Source As DataView Source = getRecordFromdatabase() Cache.Insert("employeeTable ", Source, New System.Web.Caching.CacheDependency("d:\download\tblemployee.txt"), Cache.NoAbsoluteExpiration, Cache.NoSlidingExpiration, CacheItemPriority.Normal, onRemove) EndSub |
PublicFunction getRecordFromdatabase (ByVal p_empid As Int32) As DataView Dim con As OracleConnection = Nothing Dim cmd As OracleCommand = Nothing Dim ds As DataSet = Nothing Try con = getDatabaseConnection( "UserId=scott;Password=tiger;Data Source=testingdb;") cmd = New OracleCommand("Administrator.getEmployee", con) cmd.CommandType = CommandType.StoredProcedure cmd.Parameters.Add(New OracleParameter("employeeId", OracleDbType.Int64)).Value = p_empid Dim param AsNew OracleParameter("RC1", OracleDbType.RefCursor) cmd.Parameters.Add(param).Direction = ParameterDirection.Output Dim myCommand AsNew OracleDataAdapter(cmd) ds = New DataSet myCommand.Fill(ds) Dim table As DataTable = ds.Tables(0) Dim index As Int32 = table.Rows.Count Return ds.Tables(0).DefaultView Catch ex As Exception ThrowNew Exception("Exception in Database Tier Method getRecordFromdatabase () " + ex.Message, ex) Finally Try cmd.Dispose() Catch ex As Exception Finally cmd = Nothing EndTry Try con.Close() Catch ex As Exception Finally con = Nothing EndTry EndTry EndFunction |
PublicFunction getDatabaseConnection(ByVal strconnection as string) As OracleConnection Dim con As Oracle.DataAccess.Client.OracleConnection = Nothing Try con = New Oracle.DataAccess.Client.OracleConnection con.ConnectionString = strconnection con.Open() Return con Catch ex As Exception ThrowNew Exception("Exception in Database Tier Method getOracleConnection() " + ex.Message, ex) EndTry EndFunction |
begin administrator.plfile('machine1\\download\\ tblemployee.txt'); administrator.plfile('machine2\\download\\ tblemployee.txt'); end; |
import java.io.*; public class UpdFile {public static void updateFile(String filename) { try { File f = new File(filename); f.delete(); f.createNewFile(); } catch (IOException e) { // log exception } }; |
(p_filename IN VARCHAR2) AS LANGUAGE JAVA NAME 'UpdFile.updateFile (java.lang.String)'; |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者