sl@0: // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: // All rights reserved.
sl@0: // This component and the accompanying materials are made available
sl@0: // under the terms of "Eclipse Public License v1.0"
sl@0: // which accompanies this distribution, and is available
sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: //
sl@0: // Initial Contributors:
sl@0: // Nokia Corporation - initial contribution.
sl@0: //
sl@0: // Contributors:
sl@0: //
sl@0: // Description:
sl@0: //
sl@0: 
sl@0: /**
sl@0: */
sl@0: inline void CSqlSrvSession::ConstructL()
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: */
sl@0: inline CSqlSrvSession::CSqlSrvSession()
sl@0: 	{
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: @return A reference to CSqlServer instance.
sl@0: */
sl@0: inline CSqlServer& CSqlSrvSession::Server()
sl@0: 	{
sl@0: 	return *static_cast<CSqlServer*>(const_cast<CServer2*>(CSession2::Server()));
sl@0: 	}
sl@0: 	
sl@0: /**
sl@0: Destroys CSqlSrvDatabase instance.
sl@0: */
sl@0: inline void CSqlSrvSession::DbDestroyObject()
sl@0: 	{
sl@0: 	delete iDatabase;
sl@0: 	iDatabase = NULL;
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: Processes request for executing 8-bit SQL statement(s).
sl@0: 
sl@0: The method requires a valid iDatabase object.
sl@0: 
sl@0: Usage of the IPC call arguments:
sl@0: Arg 0: [in]	8-bit character length of SQL statement.
sl@0: Arg 1: [in]	SQL statement.
sl@0: 
sl@0: @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
sl@0: */
sl@0: inline TInt CSqlSrvSession::DbExecSql8L(const RMessage2& aMessage)
sl@0: 	{
sl@0: 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
sl@0: 	iDatabase->ExecL(ReadString8ZL(aMessage, 1, aMessage.Int0()));
sl@0: 	return iDatabase->LastChangesCount();
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: Processes request for executing 16-bit SQL statement(s).
sl@0: 
sl@0: The method requires a valid iDatabase object.
sl@0: 
sl@0: Usage of the IPC call arguments:
sl@0: Arg 0: [in]	16-bit character length of SQL statement.
sl@0: Arg 1: [in]	SQL statement.
sl@0: 
sl@0: @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
sl@0: */
sl@0: inline TInt CSqlSrvSession::DbExecSql16L(const RMessage2& aMessage)
sl@0: 	{
sl@0: 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
sl@0: 	iDatabase->ExecL(ReadString16ZL(aMessage, 1, aMessage.Int0()));
sl@0: 	return iDatabase->LastChangesCount();
sl@0: 	}
sl@0: 
sl@0: /**
sl@0: Processes the request for setting the database isolation level.
sl@0: 
sl@0: The method requires a valid iDatabase object.
sl@0: 
sl@0: Usage of the IPC call arguments:
sl@0: Arg 0: [in]	Database isolation level.
sl@0: 
sl@0: @panic SqlDb 2 Client panic. iDatabase is NULL (the database object is not created yet).
sl@0: */
sl@0: inline void CSqlSrvSession::DbSetIsolationLevelL(const RMessage2& aMessage)
sl@0: 	{
sl@0: 	__SQLPANIC_CLIENT(iDatabase != NULL, aMessage, ESqlPanicInvalidObj);
sl@0: 	RSqlDatabase::TIsolationLevel level = static_cast <RSqlDatabase::TIsolationLevel> (aMessage.Int0());
sl@0: 	iDatabase->SetIsolationLevelL(level);
sl@0: 	}