Send feedback
  
   
 
  
    
      Class ConnectionOptions (0.22.1)
    
    
       
    
    
      
      Stay organized with collections
     
    
      
      Save and categorize content based on your preferences.
     
    
  
      
     
  
  
   
  
    
  
  
    
    
    
  Version 0.22.1keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   class  ConnectionOptions  
   
  
  
  Static Fields
   
  AUTOCOMMIT_PROPERTY_NAME 
  
    
public   static   final   String   AUTOCOMMIT_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  CHANNEL_PROVIDER_PROPERTY_NAME 
  
    
public   static   final   String   CHANNEL_PROVIDER_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  CREDENTIALS_PROPERTY_NAME 
  
    
public   static   final   String   CREDENTIALS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  CREDENTIALS_PROVIDER_PROPERTY_NAME 
  
    
public   static   final   String   CREDENTIALS_PROVIDER_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  DATABASE_ROLE_PROPERTY_NAME 
  
    
public   static   final   String   DATABASE_ROLE_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE_NAME 
  
    
public   static   final   String   DELAY_TRANSACTION_START_UNTIL_FIRST_WRITE_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  ENCODED_CREDENTIALS_PROPERTY_NAME 
  
    
public   static   final   String   ENCODED_CREDENTIALS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  LENIENT_PROPERTY_NAME 
  
    
public   static   final   String   LENIENT_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  MAX_SESSIONS_PROPERTY_NAME 
  
    
public   static   final   String   MAX_SESSIONS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  MIN_SESSIONS_PROPERTY_NAME 
  
    
public   static   final   String   MIN_SESSIONS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  NUM_CHANNELS_PROPERTY_NAME 
  
    
public   static   final   String   NUM_CHANNELS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  OAUTH_TOKEN_PROPERTY_NAME 
  
    
public   static   final   String   OAUTH_TOKEN_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  READONLY_PROPERTY_NAME 
  
    
public   static   final   String   READONLY_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  RETRY_ABORTS_INTERNALLY_PROPERTY_NAME 
  
    
public   static   final   String   RETRY_ABORTS_INTERNALLY_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  RPC_PRIORITY_NAME 
  
    
public   static   final   String   RPC_PRIORITY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  TRACK_CONNECTION_LEAKS_PROPERTY_NAME 
  
    
public   static   final   String   TRACK_CONNECTION_LEAKS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  TRACK_SESSION_LEAKS_PROPERTY_NAME 
  
    
public   static   final   String   TRACK_SESSION_LEAKS_PROPERTY_NAME  
   
  
    
      
        Field Value  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  VALID_PROPERTIES 
  
    
public   static   final   Set<ConnectionOptions . ConnectionProperty >  VALID_PROPERTIES  
   
  
  Static Methods
   
   
  closeSpanner() 
  
    
public   static   void   closeSpanner ()  
   
   
  getDefaultProjectId(Credentials arg0) 
  
    
public   static   String   getDefaultProjectId ( Credentials   arg0 )  
   
  
    
      
        Parameter  
       
      
        Name  
        Description  
       
      
        arg0 
        com.google.auth.Credentials  
       
     
  
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  newBuilder() 
  
    
public   static   ConnectionOptions . Builder   newBuilder ()  
   
  
  Methods
   
   
  getChannelProvider() 
  
    
public   TransportChannelProvider   getChannelProvider ()  
   
  
   
  getConnection() 
  
    
public   Connection   getConnection ()  
   
  
   
  getCredentials() 
  
    
public   Credentials   getCredentials ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        com.google.auth.Credentials  
         
       
     
  
   
  getCredentialsUrl() 
  
    
public   String   getCredentialsUrl ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getDatabaseId() 
  
    
public   DatabaseId   getDatabaseId ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        com.google.cloud.spanner.DatabaseId  
         
       
     
  
   
  getDatabaseName() 
  
    
public   String   getDatabaseName ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getDatabaseRole() 
  
    
public   String   getDatabaseRole ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getHost() 
  
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getInstanceId() 
  
    
public   String   getInstanceId ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getMaxSessions() 
  
    
public   Integer   getMaxSessions ()  
   
  
   
  getMinSessions() 
  
    
public   Integer   getMinSessions ()  
   
  
   
  getNumChannels() 
  
    
public   Integer   getNumChannels ()  
   
  
   
  getProjectId() 
  
    
public   String   getProjectId ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getSessionPoolOptions() 
  
    
public   SessionPoolOptions   getSessionPoolOptions ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        com.google.cloud.spanner.SessionPoolOptions  
         
       
     
  
   
  getUri() 
  
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  getWarnings() 
  
    
public   String   getWarnings ()  
   
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
   
  isAutoConfigEmulator() 
  
    
public   boolean   isAutoConfigEmulator ()  
   
  
   
  isAutocommit() 
  
    
public   boolean   isAutocommit ()  
   
  
   
  isReadOnly() 
  
    
public   boolean   isReadOnly ()  
   
  
   
  isRetryAbortsInternally() 
  
    
public   boolean   isRetryAbortsInternally ()  
   
  
   
  isReturnCommitStats() 
  
    
public   boolean   isReturnCommitStats ()  
   
  
   
  toString() 
  
  
    
      
        Returns  
       
      
        Type  
        Description  
       
      
        String  
         
       
     
  
  Overrides 
  
 
     
    
  
  
  
     
  
 
  
    
    
      
    
     
  
       
         
  
  
    
    Send feedback
  
   
 
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-30 UTC.
 
 
  
  
    
    
    
      
  
  
    Need to tell us more?
  
   
 
     
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-30 UTC."],[],[]]