Questions tagged [datasource]

Datasource is a name given to the connection set up to a database from a server. The name is commonly used when creating a query to the database. The database source name (DSN) does not have to be the same as the filename for the database.

A data source is any of the following types of sources for (mostly) digitized data:

  • a database (in the Java software platform, datasource is a special name for the connection set up to a database from a server)
  • a computer file
  • a data stream

Please see more here (Wikipedia entry for Datasource) and here (Java 6 Datasource interface documentation)

4740 questions
327
votes
10 answers

Spring Boot configure and use two data sources

How can I configure and use two data sources? For example, here is what I have for the first data source: application.properties #first db spring.datasource.url = [url] spring.datasource.username = [username] spring.datasource.password =…
juventus
  • 3,282
  • 3
  • 11
  • 7
162
votes
8 answers

How to use JNDI DataSource provided by Tomcat in Spring?

It is said that in the Spring javadoc article about DriverManagerDataSource class, that this class is very simple and that it is recommended to use a JNDI DataSource provided by the container. Such a DataSource can be exposed as a DataSource bean…
Suzan Cioc
  • 29,281
  • 63
  • 213
  • 385
106
votes
6 answers

Why do we use a DataSource instead of a DriverManager?

I am reading the Java JDBC specification (vr. 4) and I encountred this statement: DataSource — this interface was introduced in the JDBC 2.0 Optional Package API. It is preferred over DriverManager because it allows details about the …
LuckyLuke
  • 47,771
  • 85
  • 270
  • 434
93
votes
4 answers

What are the WCF Service Reference .datasource files?

What are the .datasource files that are automatically generated by "Create Service Reference" in Visual Studio? The comment in the file is this: This file is automatically generated by Visual Studio .Net. It is used to store generic object…
Andy White
  • 86,444
  • 48
  • 176
  • 211
89
votes
8 answers

Configure DataSource programmatically in Spring Boot

With Spring Boot I can instantiate a JdbcTemplate with the following: Code: @Autowired private JdbcTemplate…
Marsellus Wallace
  • 17,991
  • 25
  • 90
  • 154
83
votes
3 answers

Where can I find historical raw weather data?

Where can I find historical raw weather data for a project I am doing with focus on the USA and Canada. I need temperatures mainly, but other details would be nice. I am having a very hard time finding this data. I really dont want to have to…
Recursion
  • 2,915
  • 8
  • 38
  • 51
83
votes
5 answers

Should you set up database connection properties in server.xml or context.xml

I am trying to set up the database connection properties using JNDI for a Spring web application. I am considering two approaches as below: Approach 1: In your Spring configuration you may have something like:
user1016403
  • 12,151
  • 35
  • 108
  • 137
72
votes
9 answers

Binding Combobox Using Dictionary as the Datasource

I'm using .NET 2.0 and I'm trying to bind a combobox's Datasource to a sorted dictionary. So the error I'm getting is "DataMember property 'Key' cannot be found on the Datasource". SortedDictionary userCache =…
user803952
  • 894
  • 1
  • 7
  • 8
72
votes
4 answers

Angular Material Table Dynamic Columns without model

I need to use angular material table without model, because I don't know what will come from service. So I am initializing my MatTableDataSource and displayedColumns dynamically in component like that : TableComponent : ngOnInit()…
mevaka
  • 1,980
  • 2
  • 17
  • 24
70
votes
15 answers

C# dictionary - one key, many values

I want to create a data store to allow me to store some data. The first idea was to create a dictionary where you have one key with many values, so a bit like a one-to-many relationship. I think the dictionary only has one key value. How else could…
Marc G
  • 733
  • 1
  • 7
  • 7
53
votes
3 answers

Spring Data JPA - Multiple EnableJpaRepositories

My application has multiple data sources , so i have created two data source configuration classes based on this URL . But while running the spring boot application am getting error Description: Field userDataRepo in…
Ansar Samad
  • 729
  • 2
  • 8
  • 15
52
votes
7 answers

How do I manually configure a DataSource in Java?

I'm trying to follow Sun's JDBC tutorial at http://java.sun.com/docs/books/tutorial/jdbc/basics/connecting.html It gives the following example code: DataSource ds = (DataSource)…
Eric Wilson
  • 57,719
  • 77
  • 200
  • 270
51
votes
7 answers

How to Export/Import a Data Source from DataGrip?

I can't seem to figure out how to export a data source configuration in DataGrip (currently on 2016.2 EAP). I would like to export a handful of data sources and share them with my teammates to make it easier for them to get up and running on…
David Farrell
  • 3,492
  • 2
  • 15
  • 11
49
votes
6 answers

Use of multiple DataSources in Spring Batch

I am trying to configure a couple of datasources within Spring Batch. On startup, Spring Batch is throwing the following exception: To use the default BatchConfigurer the context must contain no more thanone DataSource, found 2 Snippet from Batch…
Ahmed Bhaila
  • 699
  • 1
  • 5
  • 11
46
votes
13 answers

HikariPool-1 - Connection is not available, request timed out after 30000ms for very tiny load server

I have a small Java application for testing purposes. I have moved to hikari recently. What I notice is that I keep getting this error. java.sql.SQLTransientConnectionException: HikariPool-1 - Connection is not available, request timed out after…
user8012596
  • 693
  • 1
  • 8
  • 16
1
2 3
99 100