# Datasources

## Datasources

Here is where you can register datasources globally in the runtime. You can override them at runtime via:

* `Application.bx|cfc` - For the application
* A-la-carte via query execution calls

{% code title="boxlang.json" %}

```json
// The registered global datasources in the language
// The key is the name of the datasource and the value is a struct of the datasource settings
"datasources": {
	"testDB": {
		"driver": "derby",
		"connectionString": "jdbc:derby:memory:testDB;create=true"
	}
	"testdatasource": {
	 	  "driver": "derby",
	 	  "host": "localhost",
	 	  "port": 3306,
	 	  "database": "test"
	}
},
```

{% endcode %}

The key is the name of the datasource and the value is a struct of configuration for the JDBC connection. Most of the items can be different depending on the JDBC module and driver used. However, at the end of the day we need to know at least either the `driver` , the `connectionString` or individual items of the connection. Check out our guide on [defining datasources here](/boxlang-framework/jdbc/datasources.md).

## Default Datasource

The name of the datasource in the `datasources` configuration struct, which will act as the default one for the entire runtime.

{% code title="boxlang.json" %}

```json
// You can assign a global default datasource to be used in the language
"defaultDatasource": "main",
"datasources" : {
    "main" : {...}
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://boxlang.ortusbooks.com/getting-started/configuration/datasources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
