SQL in a Nutshell, 2nd Edition [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

SQL in a Nutshell, 2nd Edition [Electronic resources] - نسخه متنی

Kevin E. Kline

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید








5.3 Closing a Database Connection


Once an application
is finished using an open connection, that connection should be
closed. Some APIs automatically close connections when the
application exits; however, it is best to explicitly close the
connection as soon as the application is finished accessing the
database to allow other applications access to precious connection
resources.


Calling the appropriate close methods when finished with an ADO.NET
or JDBC object is essential to freeing precious database resources
used by the application. Both ADO.NET and Java offer very few
guarantees when objects are finalized; therefore, it is common for
those applications that don't close objects
explicitly to run out of database resources (such as connections,
statement handles, and memory).


5.3.1 Closing an ADO.NET Database Connection


To close an
ADO.NET connection, invoke the
Close method on the connection object:

connection.Close( );


5.3.2 Closing a JDBC Database Connection


To close a
JDBC connection, invoke the
close method on the connection object:

connection.close( );


/ 78