Class Database (2.20.0) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 2.20.0keyboard_arrow_down  
  
 
    
    
    
      
  
  
  
    
public   final   class  Database   extends   GeneratedMessageV3   implements   DatabaseOrBuilder  
   Represents database access information, such as queries.
 A database may be a sub-resource of an instance (as in the case of CloudSQL
 instances or Cloud Spanner instances), or the database instance itself.
 Some database resources may not have the full resource name populated
 because these resource types are not yet supported by Cloud Asset Inventory
 (e.g. CloudSQL databases).  In these cases only the display name will be
 provided.
 Protobuf type google.cloud.securitycenter.v1.Database
Static Fields
   
  DISPLAY_NAME_FIELD_NUMBER 
  
    
public   static   final   int   DISPLAY_NAME_FIELD_NUMBER  
  Field Value 
  
  GRANTEES_FIELD_NUMBER 
  
    
public   static   final   int   GRANTEES_FIELD_NUMBER  
  Field Value 
  
  NAME_FIELD_NUMBER 
  
    
public   static   final   int   NAME_FIELD_NUMBER  
  Field Value 
  
  QUERY_FIELD_NUMBER 
  
    
public   static   final   int   QUERY_FIELD_NUMBER  
  Field Value 
  
  USER_NAME_FIELD_NUMBER 
  
    
public   static   final   int   USER_NAME_FIELD_NUMBER  
  Field Value 
  
  Static Methods
   
  getDefaultInstance() 
  
    
public   static   Database   getDefaultInstance ()  
  Returns 
  
  getDescriptor() 
  
    
public   static   final   Descriptors . Descriptor   getDescriptor ()  
  Returns 
  
  newBuilder() 
  
    
public   static   Database . Builder   newBuilder ()  
  Returns 
  
  newBuilder(Database prototype) 
  
    
public   static   Database . Builder   newBuilder ( Database   prototype )  
  Parameter 
  
  Returns 
  
  
    
public   static   Database   parseDelimitedFrom ( InputStream   input )  
  Parameter 
  
  Returns 
  
  Exceptions 
  
  
    
public   static   Database   parseDelimitedFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  parseFrom(byte[] data) 
  
    
public   static   Database   parseFrom ( byte []   data )  
  Parameter 
  
    
      
        Name Description  
      
        databyte [] 
     
  
  Returns 
  
  Exceptions 
  
  parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Database   parseFrom ( byte []   data ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  parseFrom(ByteString data) 
  
    
public   static   Database   parseFrom ( ByteString   data )  
  Parameter 
  
  Returns 
  
  Exceptions 
  
  parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Database   parseFrom ( ByteString   data ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  
    
public   static   Database   parseFrom ( CodedInputStream   input )  
  Parameter 
  
  Returns 
  
  Exceptions 
  
  
    
public   static   Database   parseFrom ( CodedInputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  
    
public   static   Database   parseFrom ( InputStream   input )  
  Parameter 
  
  Returns 
  
  Exceptions 
  
  
    
public   static   Database   parseFrom ( InputStream   input ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  parseFrom(ByteBuffer data) 
  
    
public   static   Database   parseFrom ( ByteBuffer   data )  
  Parameter 
  
  Returns 
  
  Exceptions 
  
  parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry) 
  
    
public   static   Database   parseFrom ( ByteBuffer   data ,   ExtensionRegistryLite   extensionRegistry )  
  Parameters 
  
  Returns 
  
  Exceptions 
  
  parser() 
  
    
public   static   Parser<Database>   parser ()  
  Returns 
  
  Methods
   
  equals(Object obj) 
  
    
public   boolean   equals ( Object   obj )  
  Parameter 
  
  Returns 
  
  Overrides 
  
  getDefaultInstanceForType() 
  
    
public   Database   getDefaultInstanceForType ()  
  Returns 
  
  getDisplayName() 
  
    
public   String   getDisplayName ()  
   The human readable name of the database the user connected to.
 string display_name = 2;
Returns 
  
    
      
        Type Description  
      
        String The displayName.
 
     
  
  getDisplayNameBytes() 
  
    
public   ByteString   getDisplayNameBytes ()  
   The human readable name of the database the user connected to.
 string display_name = 2;
Returns 
  
    
      
        Type Description  
      
        ByteString The bytes for displayName.
 
     
  
  getGrantees(int index) 
  
    
public   String   getGrantees ( int   index )  
   The target usernames/roles/groups of a SQL privilege grant (not an IAM
 policy change).
 repeated string grantees = 5;
Parameter 
  
    
      
        Name Description  
      
        indexint The index of the element to return.
 
     
  
  Returns 
  
    
      
        Type Description  
      
        String The grantees at the given index.
 
     
  
  getGranteesBytes(int index) 
  
    
public   ByteString   getGranteesBytes ( int   index )  
   The target usernames/roles/groups of a SQL privilege grant (not an IAM
 policy change).
 repeated string grantees = 5;
Parameter 
  
    
      
        Name Description  
      
        indexint The index of the value to return.
 
     
  
  Returns 
  
    
      
        Type Description  
      
        ByteString The bytes of the grantees at the given index.
 
     
  
  getGranteesCount() 
  
    
public   int   getGranteesCount ()  
   The target usernames/roles/groups of a SQL privilege grant (not an IAM
 policy change).
 repeated string grantees = 5;
Returns 
  
    
      
        Type Description  
      
        int The count of grantees.
 
     
  
  getGranteesList() 
  
    
public   ProtocolStringList   getGranteesList ()  
   The target usernames/roles/groups of a SQL privilege grant (not an IAM
 policy change).
 repeated string grantees = 5;
Returns 
  
  getName() 
  
  
  Returns 
  
    
      
        Type Description  
      
        String The name.
 
     
  
  getNameBytes() 
  
    
public   ByteString   getNameBytes ()  
  
  Returns 
  
  getParserForType() 
  
    
public   Parser<Database>   getParserForType ()  
  Returns 
  
  Overrides 
  
  getQuery() 
  
   The SQL statement associated with the relevant access.
 string query = 4;
Returns 
  
    
      
        Type Description  
      
        String The query.
 
     
  
  getQueryBytes() 
  
    
public   ByteString   getQueryBytes ()  
   The SQL statement associated with the relevant access.
 string query = 4;
Returns 
  
  getSerializedSize() 
  
    
public   int   getSerializedSize ()  
  Returns 
  
  Overrides 
  
  getUnknownFields() 
  
    
public   final   UnknownFieldSet   getUnknownFields ()  
  Returns 
  
  Overrides 
  
  getUserName() 
  
    
public   String   getUserName ()  
   The username used to connect to the DB. This may not necessarily be an IAM
 principal, and has no required format.
 string user_name = 3;
Returns 
  
    
      
        Type Description  
      
        String The userName.
 
     
  
  getUserNameBytes() 
  
    
public   ByteString   getUserNameBytes ()  
   The username used to connect to the DB. This may not necessarily be an IAM
 principal, and has no required format.
 string user_name = 3;
Returns 
  
    
      
        Type Description  
      
        ByteString The bytes for userName.
 
     
  
  hashCode() 
  
  Returns 
  
  Overrides 
  
  internalGetFieldAccessorTable() 
  
    
protected   GeneratedMessageV3 . FieldAccessorTable   internalGetFieldAccessorTable ()  
  Returns 
  
  Overrides 
  
  isInitialized() 
  
    
public   final   boolean   isInitialized ()  
  Returns 
  
  Overrides 
  
  newBuilderForType() 
  
    
public   Database . Builder   newBuilderForType ()  
  Returns 
  
  newBuilderForType(GeneratedMessageV3.BuilderParent parent) 
  
    
protected   Database . Builder   newBuilderForType ( GeneratedMessageV3 . BuilderParent   parent )  
  Parameter 
  
  Returns 
  
  Overrides 
  
  newInstance(GeneratedMessageV3.UnusedPrivateParameter unused) 
  
    
protected   Object   newInstance ( GeneratedMessageV3 . UnusedPrivateParameter   unused )  
  Parameter 
  
  Returns 
  
  Overrides 
  
  toBuilder() 
  
    
public   Database . Builder   toBuilder ()  
  Returns 
  
  writeTo(CodedOutputStream output) 
  
    
public   void   writeTo ( CodedOutputStream   output )  
  Parameter 
  
  Overrides 
  
  Exceptions 
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  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-11 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-11 UTC."],[],[]]