datasource

referring Tomcat JNDI datasource in persistence.xml

。_饼干妹妹 提交于 2019-11-29 12:18:28
问题 in server.xml I've defined global resource (I'm using Tomcat 6 ): <GlobalNamingResources> <Resource name="jdbc/myds" auth="Container" type="javax.sql.DataSource" maxActive="10" maxIdle="3" maxWait="10000" username="sa" password="" driverClassName="org.h2.Driver" url="jdbc:h2:~/.myds/data/db" /> </GlobalNamingResources> I see in catalina.out that this is bound, so I suppose it's OK. In my web app I have the link to the datasource, I'm not sure it's OK: <Context> <ResourceLink global='jdbc/myds

Kendo UI AutoComplete datasource transport reads only once

三世轮回 提交于 2019-11-29 12:16:41
问题 I'm becoming crazy with Kendo UI AutoComplete component. I'm using my own functions to access data with jQuery, so I have to set the AutoComplete dataSource.transport.read as a function. The code is something like this. minLengthAtocomplete = 3; $('#autocomplete').kendoAutoComplete({ minLength : 3, filter : "contains", dataValueField : "key", dataTextField : "value", dataSource : new kendo.data.DataSource({ transport : { read : _OnTransportRead }, schema : { /* object schema */ } }) });

Configuring Grails to use own DataSource implementation or to proxy the standard DataSource

混江龙づ霸主 提交于 2019-11-29 10:53:42
In an application I want to use my own implementation of javax.sql.DataSource that extends the standard org.apache.commons.dbcp.BasicDataSource used by Grails and adds the functionality to set the client identifier based on the currently logged in user at the Grails application. What is the best way to change the underlying javax.sql.DataSource implementation in a Grails application? At the moment I see two possibilities: change the implementation of the DataSource that is used by Grails proxy the DataSource that is used by Grails and add the functionality with AOP Any hints on how to deal

Database connections not closed after idle-timeout in wildfly Datasource

大憨熊 提交于 2019-11-29 09:52:39
I have an application running under wildfly 8.1 The database connections used in the applications are taken from a Datasource defined in standalone.xml file. Problem: I don't know why but the Connection from the Pool never goes Idle and are released. Eventually the Pool gets filled will all active Connection and application starts throwing javax.resource.ResourceException: IJ000453: Unable to get managed connection for java:/bo/datasource At the same time when I look at the database, most of the Connections are shown to be idle. (Configuration and result output below) I have been at this for a

Spring Boot jdbc datasource autoconfiguration fails on standalone tomcat

戏子无情 提交于 2019-11-29 09:36:58
While trying to deploy and start a spring boot application on a standalone tomcat (7) instance, we ran into an issue were the autoconfigured spring datasource bean isn't found and the corresponding exception is thrown: Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} at org.springframework.beans.factory.support

How to bind EF Code First DbContext to an Asp.Net DataSource?

纵然是瞬间 提交于 2019-11-29 09:36:49
问题 I've created the following Context to be used with Entity Framework Code First : public class Context : DbContext { public DbSet<Animal> Animals { get; set; } } Now I would like to use this Context in an Asp.Net application to perform CRUD operations using a GridView . I need to create a DataSource to do the data binding. How would I go about? The ASP part would look like this: <asp:GridView runat="server" DataSourceID="animalDataSource" DataKeyNames="AnimalID" AutoGenerateColumns="false">

What is the correct way to use Entity Framework as datasource for DataGridView?

一个人想着一个人 提交于 2019-11-29 09:36:24
I tried setting DataSource via DataGridView Designer but it wasn't listed there and then I generated new datasource via wizard which generated DataSet. But now I have Entity Framework in my project + DataSet how can I use Entity Framework only... I'm confused please help artiklBindingSource was automatically generated I only wanted to use EF as datasource now I'm stuck with unwanted DataSet and whole bunch of mess. Reza Aghaei To add a data source to use with your DataGridView in DataGridView Tasks panel, open Choose Data Source: combo box and then: Click Add Project Data Source to open Data

Not able to set spring.datasource.type

风流意气都作罢 提交于 2019-11-29 07:49:35
I'm trying to setup c3p0 on my spring boot server. This is my config right now spring.datasource.url=jdbc:mysql://url/db spring.datasource.username=username spring.datasource.password=password spring.datasource.driver-class-name=com.mysql.jdbc.Driver spring.datasource.test-on-borrow=true #spring.datasource.test-while-idle=true spring.datasource.validation-query=SELECT 1 #spring.datasource.time-between-eviction-runs-millis=10000 #spring.datasource.min-evictable-idle-time-millis=30000 spring.jpa.show-sql=true spring.jpa.properties.hibernate.globally_quoted_identifiers=true spring.jpa.properties

Oracle getConnection slow

不想你离开。 提交于 2019-11-29 04:34:29
In a Java project, I am using an ojdbc6 jar <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc6</artifactId> <version>11.2.0.1.0</version> <scope>compile</scope> </dependenc> The first time for a day I run, dataSource.getConnection() is fast. Second time is usually okay. The next few times take around 45 seconds. After that, it takes multiple minutes. Once I have the FIRST connection of a given application run, any new connections I get are very very fast. This delay is only getting the FIRST connection for a given run. What is making getting my first connection so slow? I am

Using AbstractRoutingDataSource to dynamically change the database schema/catalog

三世轮回 提交于 2019-11-29 03:02:03
问题 According to this article, you can use the AbstractRoutingDataSource from Spring Framework to dynamically change the data source used by the application. However, the data sources used are defined by configuration, instead of programmatically. Is there a way of configuring the data sources to be used at runtime? How scalable is this solution, i.e., what are the limitations in number of data sources? Thanks! 回答1: I have implemented this approach for 30 datasources and they are currently