Send feedback
Class DataSource (2.61.0)
Stay organized with collections
Save and categorize content based on your preferences.
2.61.0 (latest)
2.60.0
2.59.0
2.58.0
2.57.2
2.56.0
2.55.3
2.54.2
2.53.0
2.52.0
2.51.0
2.50.1
2.49.0
2.48.1
2.47.0
2.46.0
2.45.0
2.44.0
2.43.3
2.42.3
2.41.0
2.40.3
2.39.1
2.38.2
2.37.2
2.36.0
2.35.0
2.34.2
2.33.2
public class DataSource implements DataSource
BigQuery JDBC implementation of javax.sql.DataSource
A factory for connections to the physical data source that this DataSource object represents.
An alternative to the DriverManager facility, a DataSource object is the preferred means of
getting a connection. An object that implements the DataSource interface will typically be
registered with a naming service based on the Java™ Naming and Directory (JNDI) API.
Static Methods
fromUrl(String url)
public static DataSource fromUrl ( String url )
Parameter
Name
Description
url
String
Constructors
DataSource()
An implementation of DataSource must include a public no-arg constructor.
Methods
<T>unwrap(Class<T> iface)
public T <T>unwrap ( Class<T> iface )
Parameter
Name
Description
iface
Class <T >
Returns
Type
Description
T
getAdditionalProjects()
public String getAdditionalProjects ()
Returns
Type
Description
String
getAllowLargeResults()
public Boolean getAllowLargeResults ()
getByoidAudienceUri()
public String getByoidAudienceUri ()
Returns
Type
Description
String
getByoidCredentialSource()
public String getByoidCredentialSource ()
Returns
Type
Description
String
getByoidPoolUserProject()
public String getByoidPoolUserProject ()
Returns
Type
Description
String
getByoidSAImpersonationUri()
public String getByoidSAImpersonationUri ()
Returns
Type
Description
String
getByoidSubjectTokenType()
public String getByoidSubjectTokenType ()
Returns
Type
Description
String
getByoidTokenUri()
public String getByoidTokenUri ()
Returns
Type
Description
String
getConnection()
public Connection getConnection ()
getConnection(String username, String password)
public Connection getConnection ( String username , String password )
getConnectionPoolSize()
public Long getConnectionPoolSize ()
Returns
Type
Description
Long
getDefaultDataset()
public String getDefaultDataset ()
Returns
Type
Description
String
getDestinationDataset()
public String getDestinationDataset ()
Returns
Type
Description
String
getDestinationDatasetExpirationTime()
public Long getDestinationDatasetExpirationTime ()
Returns
Type
Description
Long
getDestinationTable()
public String getDestinationTable ()
Returns
Type
Description
String
getEnableHighThroughputAPI()
public Boolean getEnableHighThroughputAPI ()
getEnableSession()
public Boolean getEnableSession ()
getEnableWriteAPI()
public Boolean getEnableWriteAPI ()
getEndpointOverrides()
public String getEndpointOverrides ()
Returns
Type
Description
String
getFilterTablesOnDefaultDataset()
public Boolean getFilterTablesOnDefaultDataset ()
getHighThroughputActivationRatio()
public Integer getHighThroughputActivationRatio ()
getHighThroughputMinTableSize()
public Integer getHighThroughputMinTableSize ()
getHttpConnectTimeout()
public Integer getHttpConnectTimeout ()
getHttpReadTimeout()
public Integer getHttpReadTimeout ()
getJobCreationMode()
public Integer getJobCreationMode ()
getJobTimeout()
public Integer getJobTimeout ()
getKmsKeyName()
public String getKmsKeyName ()
Returns
Type
Description
String
getLabels()
public Map<String , String > getLabels ()
getListenerPoolSize()
public Long getListenerPoolSize ()
Returns
Type
Description
Long
getLocation()
public String getLocation ()
Returns
Type
Description
String
getLogLevel()
public String getLogLevel ()
Returns
Type
Description
String
getLogPath()
public String getLogPath ()
Returns
Type
Description
String
getLogWriter()
public PrintWriter getLogWriter ()
getLoginTimeout()
public int getLoginTimeout ()
Returns
Type
Description
int
getMaxResults()
public Long getMaxResults ()
Returns
Type
Description
Long
getMaximumBytesBilled()
public Long getMaximumBytesBilled ()
Returns
Type
Description
Long
public Integer getMetadataFetchThreadCount ()
getOAuth2TokenUri()
public String getOAuth2TokenUri ()
Returns
Type
Description
String
getOAuthAccessToken()
public String getOAuthAccessToken ()
Returns
Type
Description
String
getOAuthClientId()
public String getOAuthClientId ()
Returns
Type
Description
String
getOAuthClientSecret()
public String getOAuthClientSecret ()
Returns
Type
Description
String
getOAuthP12Password()
public String getOAuthP12Password ()
Returns
Type
Description
String
getOAuthPvtKey()
public String getOAuthPvtKey ()
Returns
Type
Description
String
getOAuthPvtKeyPath()
public String getOAuthPvtKeyPath ()
Returns
Type
Description
String
getOAuthRefreshToken()
public String getOAuthRefreshToken ()
Returns
Type
Description
String
getOAuthSAImpersonationChain()
public String getOAuthSAImpersonationChain ()
Returns
Type
Description
String
getOAuthSAImpersonationEmail()
public String getOAuthSAImpersonationEmail ()
Returns
Type
Description
String
getOAuthSAImpersonationScopes()
public String getOAuthSAImpersonationScopes ()
Returns
Type
Description
String
getOAuthSAImpersonationTokenLifetime()
public String getOAuthSAImpersonationTokenLifetime ()
Returns
Type
Description
String
getOAuthServiceAcctEmail()
public String getOAuthServiceAcctEmail ()
Returns
Type
Description
String
getOAuthType()
public Integer getOAuthType ()
getOverrideProperties()
public Map<String , String > getOverrideProperties ()
getParentLogger()
public Logger getParentLogger ()
Returns
Type
Description
Logger
getPartnerToken()
public String getPartnerToken ()
Returns
Type
Description
String
getPrivateServiceConnect()
public String getPrivateServiceConnect ()
Returns
Type
Description
String
getProjectId()
public String getProjectId ()
Returns
Type
Description
String
getProxyHost()
public String getProxyHost ()
Returns
Type
Description
String
getProxyPort()
public String getProxyPort ()
Returns
Type
Description
String
getProxyPwd()
public String getProxyPwd ()
Returns
Type
Description
String
getProxyUid()
public String getProxyUid ()
Returns
Type
Description
String
getQueryDialect()
public String getQueryDialect ()
Returns
Type
Description
String
getQueryProperties()
public Map<String , String > getQueryProperties ()
getRequestGoogleDriveScope()
public Integer getRequestGoogleDriveScope ()
getRequestReason()
public String getRequestReason ()
Returns
Type
Description
String
getRetryInitialDelay()
public Integer getRetryInitialDelay ()
getRetryMaxDelay()
public Integer getRetryMaxDelay ()
getSSLTrustStorePassword()
public String getSSLTrustStorePassword ()
Returns
Type
Description
String
getSSLTrustStorePath()
public String getSSLTrustStorePath ()
Returns
Type
Description
String
getSwaActivationRowCount()
public Integer getSwaActivationRowCount ()
getSwaAppendRowCount()
public Integer getSwaAppendRowCount ()
getTimeout()
public Integer getTimeout ()
getURL()
Returns
Type
Description
String
getUniverseDomain()
public String getUniverseDomain ()
Returns
Type
Description
String
getUnsupportedHTAPIFallback()
public Boolean getUnsupportedHTAPIFallback ()
getUseQueryCache()
public Boolean getUseQueryCache ()
getUseStatelessQueryMode()
public Boolean getUseStatelessQueryMode ()
getUserAgent()
public String getUserAgent ()
Returns
Type
Description
String
isWrapperFor(Class<?> iface)
public boolean isWrapperFor ( Class <? > iface )
Parameter
Name
Description
iface
Class <? >
setAdditionalProjects(String additionalProjects)
public void setAdditionalProjects ( String additionalProjects )
Parameter
Name
Description
additionalProjects
String
setAllowLargeResults(Boolean allowLargeResults)
public void setAllowLargeResults ( Boolean allowLargeResults )
Parameter
Name
Description
allowLargeResults
Boolean
setByoidAudienceUri(String byoidAudienceUri)
public void setByoidAudienceUri ( String byoidAudienceUri )
Parameter
Name
Description
byoidAudienceUri
String
setByoidCredentialSource(String byoidCredentialSource)
public void setByoidCredentialSource ( String byoidCredentialSource )
Parameter
Name
Description
byoidCredentialSource
String
setByoidPoolUserProject(String byoidPoolUserProject)
public void setByoidPoolUserProject ( String byoidPoolUserProject )
Parameter
Name
Description
byoidPoolUserProject
String
setByoidSAImpersonationUri(String byoidSAImpersonationUri)
public void setByoidSAImpersonationUri ( String byoidSAImpersonationUri )
Parameter
Name
Description
byoidSAImpersonationUri
String
setByoidSubjectTokenType(String byoidSubjectTokenType)
public void setByoidSubjectTokenType ( String byoidSubjectTokenType )
Parameter
Name
Description
byoidSubjectTokenType
String
setByoidTokenUri(String byoidTokenUri)
public void setByoidTokenUri ( String byoidTokenUri )
Parameter
Name
Description
byoidTokenUri
String
setConnectionPoolSize(Long connectionPoolSize)
public void setConnectionPoolSize ( Long connectionPoolSize )
Parameter
Name
Description
connectionPoolSize
Long
setDefaultDataset(String defaultDataset)
public void setDefaultDataset ( String defaultDataset )
Parameter
Name
Description
defaultDataset
String
setDestinationDataset(String destinationDataset)
public void setDestinationDataset ( String destinationDataset )
Parameter
Name
Description
destinationDataset
String
setDestinationDatasetExpirationTime(long destinationDatasetExpirationTime)
public void setDestinationDatasetExpirationTime ( long destinationDatasetExpirationTime )
Parameter
Name
Description
destinationDatasetExpirationTime
long
setDestinationTable(String destinationTable)
public void setDestinationTable ( String destinationTable )
Parameter
Name
Description
destinationTable
String
setEnableHighThroughputAPI(Boolean enableHighThroughputAPI)
public void setEnableHighThroughputAPI ( Boolean enableHighThroughputAPI )
Parameter
Name
Description
enableHighThroughputAPI
Boolean
setEnableSession(Boolean enableSession)
public void setEnableSession ( Boolean enableSession )
Parameter
Name
Description
enableSession
Boolean
setEnableWriteAPI(Boolean enableWriteAPI)
public void setEnableWriteAPI ( Boolean enableWriteAPI )
Parameter
Name
Description
enableWriteAPI
Boolean
setEndpointOverrides(String endpointOverrides)
public void setEndpointOverrides ( String endpointOverrides )
Parameter
Name
Description
endpointOverrides
String
setFilterTablesOnDefaultDataset(Boolean filterTablesOnDefaultDataset)
public void setFilterTablesOnDefaultDataset ( Boolean filterTablesOnDefaultDataset )
Parameter
Name
Description
filterTablesOnDefaultDataset
Boolean
setHighThroughputActivationRatio(Integer highThroughputActivationRatio)
public void setHighThroughputActivationRatio ( Integer highThroughputActivationRatio )
Parameter
Name
Description
highThroughputActivationRatio
Integer
setHighThroughputMinTableSize(Integer highThroughputMinTableSize)
public void setHighThroughputMinTableSize ( Integer highThroughputMinTableSize )
Parameter
Name
Description
highThroughputMinTableSize
Integer
setHttpConnectTimeout(Integer httpConnectTimeout)
public void setHttpConnectTimeout ( Integer httpConnectTimeout )
Parameter
Name
Description
httpConnectTimeout
Integer
setHttpReadTimeout(Integer httpReadTimeout)
public void setHttpReadTimeout ( Integer httpReadTimeout )
Parameter
Name
Description
httpReadTimeout
Integer
setJobCreationMode(Integer jobCreationMode)
public void setJobCreationMode ( Integer jobCreationMode )
Parameter
Name
Description
jobCreationMode
Integer
setJobTimeout(Integer jobTimeout)
public void setJobTimeout ( Integer jobTimeout )
Parameter
Name
Description
jobTimeout
Integer
setKmsKeyName(String kmsKeyName)
public void setKmsKeyName ( String kmsKeyName )
Parameter
Name
Description
kmsKeyName
String
setLabels(Map<String,String> labels)
public void setLabels ( Map<String , String > labels )
setListenerPoolSize(Long listenerPoolSize)
public void setListenerPoolSize ( Long listenerPoolSize )
Parameter
Name
Description
listenerPoolSize
Long
setLocation(String location)
public void setLocation ( String location )
Parameter
Name
Description
location
String
setLogLevel(String logLevel)
public void setLogLevel ( String logLevel )
Parameter
Name
Description
logLevel
String
setLogPath(String logPath)
public void setLogPath ( String logPath )
Parameter
Name
Description
logPath
String
setLogWriter(PrintWriter out)
public void setLogWriter ( PrintWriter out )
setLoginTimeout(int seconds)
public void setLoginTimeout ( int seconds )
Parameter
Name
Description
seconds
int
setMaxResults(Long maxResults)
public void setMaxResults ( Long maxResults )
Parameter
Name
Description
maxResults
Long
setMaximumBytesBilled(Long maximumBytesBilled)
public void setMaximumBytesBilled ( Long maximumBytesBilled )
Parameter
Name
Description
maximumBytesBilled
Long
public void setMetadataFetchThreadCount ( Integer metadataFetchThreadCount )
Parameter
Name
Description
metadataFetchThreadCount
Integer
setOAuth2TokenUri(String oAuth2TokenUri)
public void setOAuth2TokenUri ( String oAuth2TokenUri )
Parameter
Name
Description
oAuth2TokenUri
String
setOAuthAccessToken(String oAuthAccessToken)
public void setOAuthAccessToken ( String oAuthAccessToken )
Parameter
Name
Description
oAuthAccessToken
String
setOAuthClientId(String oAuthClientId)
public void setOAuthClientId ( String oAuthClientId )
Parameter
Name
Description
oAuthClientId
String
setOAuthClientSecret(String oAuthClientSecret)
public void setOAuthClientSecret ( String oAuthClientSecret )
Parameter
Name
Description
oAuthClientSecret
String
setOAuthP12Password(String oAuthP12Password)
public void setOAuthP12Password ( String oAuthP12Password )
Parameter
Name
Description
oAuthP12Password
String
setOAuthPvtKey(String oAuthPvtKey)
public void setOAuthPvtKey ( String oAuthPvtKey )
Parameter
Name
Description
oAuthPvtKey
String
setOAuthPvtKeyPath(String oAuthPvtKeyPath)
public void setOAuthPvtKeyPath ( String oAuthPvtKeyPath )
Parameter
Name
Description
oAuthPvtKeyPath
String
setOAuthRefreshToken(String oAuthRefreshToken)
public void setOAuthRefreshToken ( String oAuthRefreshToken )
Parameter
Name
Description
oAuthRefreshToken
String
setOAuthSAImpersonationChain(String oAuthSAImpersonationChain)
public void setOAuthSAImpersonationChain ( String oAuthSAImpersonationChain )
Parameter
Name
Description
oAuthSAImpersonationChain
String
setOAuthSAImpersonationEmail(String oAuthSAImpersonationEmail)
public void setOAuthSAImpersonationEmail ( String oAuthSAImpersonationEmail )
Parameter
Name
Description
oAuthSAImpersonationEmail
String
setOAuthSAImpersonationScopes(String oAuthSAImpersonationScopes)
public void setOAuthSAImpersonationScopes ( String oAuthSAImpersonationScopes )
Parameter
Name
Description
oAuthSAImpersonationScopes
String
setOAuthSAImpersonationTokenLifetime(String oAuthSAImpersonationTokenLifetime)
public void setOAuthSAImpersonationTokenLifetime ( String oAuthSAImpersonationTokenLifetime )
Parameter
Name
Description
oAuthSAImpersonationTokenLifetime
String
setOAuthServiceAcctEmail(String oAuthServiceAcctEmail)
public void setOAuthServiceAcctEmail ( String oAuthServiceAcctEmail )
Parameter
Name
Description
oAuthServiceAcctEmail
String
setOAuthType(Integer oAuthType)
public void setOAuthType ( Integer oAuthType )
Parameter
Name
Description
oAuthType
Integer
setPartnerToken(String partnerToken)
public void setPartnerToken ( String partnerToken )
Parameter
Name
Description
partnerToken
String
setPrivateServiceConnect(String privateServiceConnect)
public void setPrivateServiceConnect ( String privateServiceConnect )
Parameter
Name
Description
privateServiceConnect
String
setProjectId(String projectId)
public void setProjectId ( String projectId )
Parameter
Name
Description
projectId
String
setProxyHost(String proxyHost)
public void setProxyHost ( String proxyHost )
Parameter
Name
Description
proxyHost
String
setProxyPort(String proxyPort)
public void setProxyPort ( String proxyPort )
Parameter
Name
Description
proxyPort
String
setProxyPwd(String proxyPwd)
public void setProxyPwd ( String proxyPwd )
Parameter
Name
Description
proxyPwd
String
setProxyUid(String proxyUid)
public void setProxyUid ( String proxyUid )
Parameter
Name
Description
proxyUid
String
setQueryDialect(String queryDialect)
public void setQueryDialect ( String queryDialect )
Parameter
Name
Description
queryDialect
String
setQueryProperties(Map<String,String> queryProperties)
public void setQueryProperties ( Map<String , String > queryProperties )
setRequestGoogleDriveScope(Integer requestGoogleDriveScope)
public void setRequestGoogleDriveScope ( Integer requestGoogleDriveScope )
Parameter
Name
Description
requestGoogleDriveScope
Integer
setRequestReason(String requestReason)
public void setRequestReason ( String requestReason )
Parameter
Name
Description
requestReason
String
setRetryInitialDelay(Integer retryInitialDelay)
public void setRetryInitialDelay ( Integer retryInitialDelay )
Parameter
Name
Description
retryInitialDelay
Integer
setRetryMaxDelay(Integer retryMaxDelay)
public void setRetryMaxDelay ( Integer retryMaxDelay )
Parameter
Name
Description
retryMaxDelay
Integer
setSSLTrustStorePassword(String sslTrustStorePassword)
public void setSSLTrustStorePassword ( String sslTrustStorePassword )
Parameter
Name
Description
sslTrustStorePassword
String
setSSLTrustStorePath(String sslTrustStorePath)
public void setSSLTrustStorePath ( String sslTrustStorePath )
Parameter
Name
Description
sslTrustStorePath
String
setSwaActivationRowCount(Integer swaActivationRowCount)
public void setSwaActivationRowCount ( Integer swaActivationRowCount )
Parameter
Name
Description
swaActivationRowCount
Integer
setSwaAppendRowCount(Integer swaAppendRowCount)
public void setSwaAppendRowCount ( Integer swaAppendRowCount )
Parameter
Name
Description
swaAppendRowCount
Integer
setTimeout(Integer timeout)
public void setTimeout ( Integer timeout )
Parameter
Name
Description
timeout
Integer
setURL(String URL)
public void setURL ( String URL )
Parameter
Name
Description
URL
String
setUniverseDomain(String universeDomain)
public void setUniverseDomain ( String universeDomain )
Parameter
Name
Description
universeDomain
String
setUnsupportedHTAPIFallback(Boolean unsupportedHTAPIFallback)
public void setUnsupportedHTAPIFallback ( Boolean unsupportedHTAPIFallback )
Parameter
Name
Description
unsupportedHTAPIFallback
Boolean
setUseQueryCache(Boolean useQueryCache)
public void setUseQueryCache ( Boolean useQueryCache )
Parameter
Name
Description
useQueryCache
Boolean
setUserAgent(String userAgent)
public void setUserAgent ( String userAgent )
Parameter
Name
Description
userAgent
String
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 2026-03-14 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 2026-03-14 UTC."],[],[]]