1 21 22 package org.apache.derby.iapi.sql.conn; 23 24 import org.apache.derby.iapi.services.context.ContextService; 25 import org.apache.derby.iapi.error.StandardException; 26 import org.apache.derby.iapi.services.i18n.MessageService; 27 import org.apache.derby.iapi.reference.SQLState; 28 import org.apache.derby.iapi.error.ExceptionSeverity; 29 30 import java.sql.SQLException ; 31 32 public class ConnectionUtil { 33 34 41 public static LanguageConnectionContext getCurrentLCC() 42 throws SQLException { 43 44 LanguageConnectionContext lcc = (LanguageConnectionContext) 45 ContextService.getContextOrNull(LanguageConnectionContext.CONTEXT_ID); 46 47 if (lcc == null) 48 throw new SQLException ( 49 MessageService.getTextMessage( 51 SQLState.NO_CURRENT_CONNECTION), 52 SQLState.NO_CURRENT_CONNECTION, 53 ExceptionSeverity.SESSION_SEVERITY); 54 55 return lcc; 56 } 57 } 58 | Popular Tags |