datasource

SpringBoot and SpringJDBC multiple datasources

旧街凉风 提交于 2019-12-11 02:23:54
问题 I am trying to use two datasources with my SpringBoot application and can't get the second datasource to autowire. I have tried many things but this is the closest I have come: My Yaml file: spring: first-datasource: url: MyURLString1 username: User password: Password driver-class-name: oracle.jdbc.OracleDriver second-datasource: url: MyURLString2 username: User password: Password driver-class-name: oracle.jdbc.OracleDriver My Application Class: @SpringBootApplication public class

How to configurate C3P0 to use datasource url for connection at the oracle database in jboss AS7

人盡茶涼 提交于 2019-12-11 00:44:45
问题 we are having trouble to configure c3p0 in jboss, there are 2 configurations files, and we don't know wich we have to change: Jboss datasource app-ds.xml: <datasources> <datasource jta="false" jndi-name="java:/TestJNDI" pool-name="TestPool" use-ccm="false"> <connection-url>jdbc:oracle:thin:@server_test:port:database</connection-url> <connection-property name="schema">schema</connection-property> <driver-class>oracle.jdbc.OracleDriver</driver-class> <driver>ojdbc6.jar</driver> <pool> <min-pool

If i create a Spring datasource, do i still need to define the datasource inside Tomcat context.xml?

徘徊边缘 提交于 2019-12-11 00:22:47
问题 currently we have an application that is configured by using a datasource inside a Tomcat context.xml file. So we are able to succesfully get a connection by retrieving the JNDI name and get a connection. I was wondering if we could replace this by using a Spring datasource and if we still need the information inside the context.xml file? Example 'context.xml': <?xml version="1.0" encoding="UTF-8"?> <Context> <Resource name="jdbc/myDataSource" auth="Container" type="javax.sql.DataSource"

Visual Studio 2015 - Add new data source

余生颓废 提交于 2019-12-10 23:34:45
问题 I need to create a new data source starting from a custom object. This seems possible in Visual Studio 2015 as stated here , but I can't find the Project > Add New Data Source menu entry. I also tried: this answer but the stated menu entry does not exist in VS2015 and the key shortcut just expands the Debug menu updating VS2015 to Update 3 enabling all components that seemed relevant to the matter creating a custom dataset, but VS always asks me for a DB connection So far no luck in finding

Tomcat JNDI resource name aliases

半腔热情 提交于 2019-12-10 22:29:29
问题 Is it possible to create a JNDI tomcat resource with multiple names (synonyms, aliases)? Something like <Resource name="jdbc/product-ds" alias="jdbc/product-cfg-ds" type="com.mchange.v2.c3p0.ComboPooledDataSource" ... /> I need this, because there are two modules which use the same DataSource, but with different JNDI name. The simplest solution will be to sync those names, but unfortunately it's not possible at the moment. 回答1: You can do this. It took me a while to work out the correct

BindingException occurs when multiple datasources are configured in Spring Boot and MyBatis project

僤鯓⒐⒋嵵緔 提交于 2019-12-10 22:15:50
问题 This question comes along NoUniqueBeanDefinitionException when multiple datasouces in Spring Boot and Mybatis project. I try to configure two dataSources in Spring Boot and MyBatis project, but exception occurs: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.bookSystem.mapper.UserDao.findByDomain at org.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:227) ~[mybatis-3.4.6.jar:3.4.6] at org.apache.ibatis.binding.MapperMethod.(MapperMethod

阿里巴巴Druid数据源的配置与使用

China☆狼群 提交于 2019-12-10 20:12:10
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Druid是阿里巴巴开源平台上的一个项目,整个项目由数据库连接池、插件框架和SQL解析器组成。该项目主要是为了扩展JDBC的一些限制,可以让程序员实现一些特殊的需求,比如向密钥服务请求凭证、统计SQL信息、SQL性能收集、SQL注入检查、SQL翻译等,程序员可以通过定制来实现自己需要的功能。 该项目在阿里巴巴内部得到了广泛的部署,在外部也有大量的用户群。为了使大家更好地了解和使用Druid在此做一些简单的介绍,以帮助大家快速入门。 目前比较流行的数据源还有:c3p0,dbcp,proxool,BoneCP等。其中spring,hibernate都默认推荐使用c3p0,Tomcat默认使用dbcp。 以下是本人连接mysql数据库测试的性能:(本人水平有限,仅做参考,不同的数据库,不同的环境可能存在较大差异) 连续操作1000次数据库写入操作的用时比较: 数据源 用时 ms C3p0 3630 proxool 3240 druid 3190 dbcp 3264 根据分析,druid性能超过其他数据源,但在多次运行过程是druid、proxool出现崩溃两次。C3p0和dbcp在相对比较稳定。其中c3p0有自动回收连接功能,而dbcp没有自动回收连接的功能。 好了,废话少说,下面快速给大家使用druid配置数据连接

JTA Datasources without transactions

柔情痞子 提交于 2019-12-10 19:32:26
问题 (Assuming manual enlistment and delistment of resources.) I have a number of XA enabled resources/datasource for which I plan to perform transactional updates. Additionally, some of the XA-enabled datasources can be updated in isolation (without requiring any other resource). Assuming I have already committed a number of transactions with a datasource enlisted, can I then ignore the TransactionManager for unilateral updates to the datasource. Do I simply not start a global transaction and

Android: how to add items and refresh list when using PagedList?

南楼画角 提交于 2019-12-10 18:56:11
问题 I've used PagedList for loading page of items and display them in RecyclerView, and it is successfully displaying list of numbers(0,1,2,3....,99), the list can always be scroll up and down without any problem. When I tried to click a button to call appendItems() to append new data, its still fine. However, the app crashed when I scroll the list. java.util.ConcurrentModificationException at java.util.AbstractList$SubAbstractList.size(AbstractList.java:360) at androidx.paging.PagedStorage.get

Storing data in XML or SQL?

本秂侑毒 提交于 2019-12-10 17:14:24
问题 I'm developing a Windows Phone 7.5 app. I have to store 22 items with the following fields: Number (int). Name (string). Description (string). Name and description will be in various languages. Now, I'm using a XML file like this: <?xml version="1.0" encoding="utf-8" ?> <cards> <card id ="0" name="Mad" description="xxx" ></card> ... </cards> I haven't work with XML a lot, and I'm not sure which is the best way to do it. Any advice? What do you recommend me? I need to store each name and