datasource 1 « Database « Spring Q&A





1. Maven profiles basic datasource, jee:jndi-lookup    stackoverflow.com

I have a project with spring and maven. I found that using profiles, maven could change the properties of the data source. But what if in production the datasource is with ...

2. How to use Grails dataSource in resources.groovy?    stackoverflow.com

I have an external java library I am using in my Grails project. It needs a DataSource via the Spring configuration. However, the dataSource appears to not be accessible ...

3. IllegalArgumentException for dataSource in Spring application    stackoverflow.com

I am trying to deploy a simple spring app. It takes a username(from a jsp), insets the value into a db and displays a greeting on a new jsp page ...

4. Why can I run JUnit tests for my Spring project, but not a main method?    stackoverflow.com

I am using JDBC to connect to MySQL for a small application. In order to test without altering the real database, I'm using HSQL in memory for JUnit tests. I'm using ...

5. how to setup dynamic datasources in Spring.NET    stackoverflow.com

I'm working on a project wherein each time a new client comes in, a new database is created for that specific client. In setting up the datasource, it is normally done ...

6. Cannot find class [org.springframework.jdbc.datasource.DriverManagerDataSourc[    stackoverflow.com

ok log4j and servlett bugs have been fixed. next up is this one :( [QUOTE]Cannot find class [org.springframework.jdbc.datasource.DriverManagerDataSourc[/QUOTE] my current web.xml looks like this:

[QUOTE]<?xml version="1.0" encoding="UTF-8"?>

<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
   ...

7. Handling DataAccessException for Spring JDBC    stackoverflow.com

I am using a Datasource to log my audit information per user-request. The bean is defined in a springContext.xml sourced during initialization. Whenever the DB is down, the bean initialization fails with following ...

8. Spring and Mybatis multiple data sources setup    stackoverflow.com

My applications uses Spring3+MyBatis3. I'm trying to setup multiple data source for it. Setup looks like:

<!-- db1 setup-->
<bean id="db1SqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"
    p:configLocation="WEB-INF/mybatis/sqlMapConfig.xml"
    p:dataSource-ref="db1DataSource" />
<bean id="db1SqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
 ...

9. referencing configuration.properties outside of the .war    stackoverflow.com

i want to deploy a war and the war should fetch some properties from outside the war (lets say where the .war file is, that same directory.) at the moment this ...





10. how to get a spring declared datasource in an xml config file    stackoverflow.com

i have a spring datasource which looks like this:

<bean id="dataSource1" destroy-method="close" class="org.apache.commons.dbcp.BasicDataSource">
    <property name="driverClassName" value="${database.driver}" />
    <property name="url" value="${database1.url}" />
    <property name="username" ...

11. org.springframework.jdbc.datasource.DriverManagerD ataSource is it threadsafe?    stackoverflow.com

We would like to know whether the following data source org.springframework.jdbc.datasource.DriverManagerD ataSource is threadsafe and can be used in production environment? Any links to a source that confirms it would be helpful. regards aravias ...

12. Spring and connecting to AS400    stackoverflow.com

I am trying to connect to AS400 using spring but I am having no luck. I was wondering is it possible to set the default schema in spring using the class AS400JDBCConnectionPoolDataSource? here ...

13. Another question on Spring 3, servlet, @autowired    stackoverflow.com

I think I've read every question and answer on Spring and autowiring a servlet, both here and at springsource.org, and I still can't get it working. All I want to do is ...

14. Should I close JNDI-obtained data source?    stackoverflow.com

Update: Apparently Tomcat, starting with 7.0.11, closes the DataSource for you, so it's not available in the webapp's contextDestroyed. See: https://issues.apache.org/bugzilla/show_bug.cgi?id=25060 Hi, I'm using Spring 3.0 and Java 1.6. If I ...

15. How to test a mocked JNDI datasource with Spring?    stackoverflow.com

I am fairly new to Spring and wondering how to create JUnit tests that use a mocked datasource and how to use a JNDI context with that? Currently my application uses ...

16. Maven Profiles, Spring, JDBC and JNDI Datasources    stackoverflow.com

I have a Spring project that uses Maven and has several profiles to allow it to run on different setups with resource filtering. Some of the setups have JNDI and some ...





17. spring not able to find JNDI data source    stackoverflow.com

I am developing a spring web application . A JAR file which I use in my application , is looking for DataSource using JNDI. I configured the element in my ...

18. Spring autowiring Weblogic deployment fails if datasource is down    stackoverflow.com

Why do I get a DataSourceLookupFailureException casued by a NameNotFoundException when deploying my war when the datasource is down? If the datasource is up and running, the deployment works fine, ...

19. Having more than one data source    stackoverflow.com

I haven't found a question on this topic so I'll ask. I've never actually tackled something which uses more than one data source. One example would be ETL which ...

20. Spring datasource configuration for localhost, development, and production    stackoverflow.com

I'm trying to figure out how my Spring app can determine where it is deployed and load the appropriate datasource. We have 3 environments...my local, the development server, and the ...

21. Configuring Datasource in Spring 3.0    stackoverflow.com

Hello guys I have configured a connection pool and JNDI resource in glassfish 2.1. I can get the Datasource via lookup method in my projects and everything works good. However I ...

22. Dynamic DataSource Routing    stackoverflow.com

Sorry for my bad English. I wrote implementation for AbstractRoutingDataSource:

public class DatabaseRoutingDataSource extends AbstractRoutingDataSource{

    @Override
    protected Object determineCurrentLookupKey() {      
 ...

23. Spring: Trouble wiring up a datasource in a Junit test    stackoverflow.com

I'm using Spring 3.1.0.M2. I'm writing some JUnit 4 tests to test some database functionality, but I'm having trouble wiring up my datasource. In my JUnit class, I have ...

24. How to create Dynamic connections (datasource) in spring using JDBC    stackoverflow.com

I have a a spring application where i need to get server details for a oracle table and create dynamic connections as and when require based on some server id, How can ...

25. Most Robust Data Source for Production Environment    stackoverflow.com

I was using DriverManagerDataSource for local development. I am currently using org.apache.commons.dbcp.BasicDataSource now because too many connections were being created. Does anyone have suggestions on what the best way to go about ...

26. Change spring datasource settings at runtime    stackoverflow.com

I have a spring web application which a user can deploy on their own servers. Once the application is running, the adminstrator can set the database URL and credentials from ...

27. How to fetch value of the Datasource in spring frarmework using JAVA code?    stackoverflow.com

I have spring application and using property file want to read the values from the PropertyPlaceholderConfigurer. Here datasource is given as Id. I want to read the values of the datasource ...

28. Multiple datasources    forum.springsource.org

Hi all, I have an app that connects to multiple datasources but the tables underneath are exactly the same. We've been running into problems using the default HibernateTemplate since it requires ...

29. manually dataSource implementation problem    forum.springsource.org

manually dataSource implementation problem hi to all. i want to have a custom authentication-manager that check users username and password and authority in a database tables and if users exists, create ...

30. Dynamic datasources at runtime    forum.springsource.org

Dynamic datasources at runtime It seems like a lot of people had this problem. Basically they want to have dynamic datasources defined only at runtime and not defined beforehand in the ...

31. Customize a JNDI dataSource connection    forum.springsource.org

Customize a JNDI dataSource connection All, I am connecting to an oracle database using a jndi-lookup datasource like so, I need to basically issue "alter session" sql commands ...

32. making a spring datasource available on jndi    forum.springsource.org

hi guys, i have a spring datasource which looks like this: Code:

33. How to "reload" datasource    forum.springsource.org

Hi, Not sure if this is a bean factory question or data access question, but anyway ... I am just wondering how to deal with DBMS crash or periodic shutdown. The ...

34. org.springframework.jdbc.datasource.DriverManagerD ataSource is it threadsafe?    forum.springsource.org

Yes it is threadsafe and no you don't want to use it in production. In production you want to use a ConnectionPool which DriverManagerDataSource isnot... DriverManagerDataSource is basically intended for testing ...

35. help for dynamic datasource configration for Spring?    forum.springsource.org

help for dynamic datasource configration for Spring? hi all, I have a little loan management project(the server side : spring + hibernate + mysql and the client side : Eclipse Rcp, ...

36. Do I need to close a JNDI data source?    forum.springsource.org

Hi, If I get a data source this way: Code: then the data source ...

37. Setting defaultAutoCommit on DataSource to false rolls back every query    forum.springsource.org

Setting defaultAutoCommit on DataSource to false rolls back every query In my web-based Spring application I'm using the org.apache.commons.dbcp.BasicDataSource bean along with the JdbcTemplate to connect to a MySql database. When ...

38. Adding properties to Jboss JNDI DataSource    forum.springsource.org

Adding properties to Jboss JNDI DataSource Hi, I'm using Jboss AS 6 with Spring 2.5.6 In my applicationContext.xml, I have: Code: This is the xml of my datasource: ...

39. pass datasource to spring context w/ multi xml    forum.springsource.org

pass datasource to spring context w/ multi xml I am developing an API to access database[only selects]using hibernate. I want to make this API to be able to receive the applicationContext ...

40. Setting Schema for Each DataSource.getConnection() Call    forum.springsource.org

Setting Schema for Each DataSource.getConnection() Call I'm working on a multi-company system where each company's data is stored in a separate schema in a single physical database. During an application session, ...

41. Datasource problem    forum.springsource.org

Datasource problem I am getting error in applicationContext.xml nested propertyAccessExceptions are: [org.springframework.beans.TypeMismatchException: Failed to convert property value of type [org.enhydra.jdbc.oracle.OracleXADataSource] to required type [javax.sql.DataSource] for property 'dataSource'] at org.springframework.beans.BeanWrapperImpl.doTypeCo nversionIfNecessary(BeanWr apperImpl.java:905) ...

42. container is searching for persistence.xml inspite of having the dataSource object    forum.springsource.org

May 5th, 2011, 09:10 AM #1 msk.apk View Profile View Forum Posts Private Message Junior Member Join Date May 2011 Posts 4 container is searching for persistence.xml inspite of having the ...

43. datasource xml is not reading from Jboss deploy folder    forum.springsource.org

Hi all I put my xx-ora-ds.xml in C:\JBOSS\jboss-5.1.0.GA-C4v1.2\server\default\deploy folder am traying to retrive it from ejb-context.xml the code is I am getting the ...

44. datasource creation prob    forum.springsource.org

datasource creation prob I am traying to set datasource in my bean class using context .xml iam getting folloving eception plz help org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'Template' defined ...

45. catching unavailable data source    forum.springsource.org

I have inherited some code based upon JdbcDaoSupport for a server that does mostly READs, but occasionally WRITEs for a few isolated features. Mgmt want the app to work if the ...

46. Configure Spring data source for test & production environment    forum.springsource.org

Configure Spring data source for test & production environment Hi all, I have configured DataSource in applicationContext, using propertyPlaceHolder Code: ...

47. Creating multiple datasources at runtime    forum.springsource.org

Creating multiple datasources at runtime I am new to the spring framework and so far love it. My application does not know anything about how many datasources will be needed or ...

48. Ignoring missing Jndi DataSource within IDE?    forum.springsource.org

Ignoring missing Jndi DataSource within IDE? Hi all, I have been running unit tests through my JBuilder IDE using a DBCP datasource defined in the Spring config. At deployment time, I ...

49. Custom Datasource    forum.springsource.org

Custom Datasource What are the trade-offs to have a custom Datasource by extending the AbstractDatasource and implementing for example the SmartDataSource? Background: We are using the Springframework with a Oracle database ...

50. JPAEntityManager reporting that it already has a datasource? How can this be?    forum.springsource.org

JPAEntityManager reporting that it already has a datasource? How can this be? Hi all, I have a BPM application that I am deploying in Alfresco/Activiti 5.5 and it is configured with ...

51. Datasource JNDI Lookup and cache    forum.springsource.org

52. How to (dynamically) select a dataSource at dev time ?    forum.springsource.org

How to (dynamically) select a dataSource at dev time ? What I would like to select a database before starting up a server during development (using STS 2.6.1 on XP). I ...

53. Configuring multiple JNDI lookup to have 2 different datasources in Spring.    forum.springsource.org

Configuring multiple JNDI lookup to have 2 different datasources in Spring. I am trying to define two Datasources by defining two JNDI lookups as follows: Code:

54. Configuring multiple JNDI lookup to have 2 different datasources in Spring.    forum.springsource.org

Configuring multiple JNDI lookup to have 2 different datasources in Spring. I am trying to define two Datasources and use both at the same time by defining two JNDI lookups as ...

55. Spring+JBoss7 - aop problems to get datasource    forum.springsource.org

Spring+JBoss7 - aop problems to get datasource Hello there, context: im trying to get a jndi datasource set on JBoss 7 in my application that use spring 3, so i have ...

56. Trouble using SimpleNamingContextBuilder in integration test to create datasource    forum.springsource.org

Trouble using SimpleNamingContextBuilder in integration test to create datasource In my context, I have a handful of elements like this: Code: In my appserver, I'll configure a datasource ...

57. conditional jndi / jdbc datasource on configuration    forum.springsource.org

conditional jndi / jdbc datasource on configuration I'm currently dealing with a requirement to implement a strategy for a web application where I can read in a set of properties and ...

58. Trouble wiring datasource in a JUnit test    forum.springsource.org

Hi, I'm using Spring 3.1.0.M3. I have this in my JUnit test ... Code: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(loader=AnnotationConfigContextLoader.class, classes={DataSource.class, WebLeadsDAOImpl.class}) public class TestDB { @Autowired private SessionFactory sessionFactory; which results in an exception ...

59. JDBC Data Source are getting Leaked when using Spring Frame work    forum.springsource.org

In general that is a sign of no or wrong transaction management/configuration. For spring to manage resources correctly you will need to setup transactions correctly.

60. RoutingDataSource for a non-JDBC DataSource    forum.springsource.org

RoutingDataSource for a non-JDBC DataSource Hello, I would like to implement the same dynamic routing mechanism provided by org.springframework.jdbc.datasource.lookup.Abstrac tRoutingDataSource but using as DataSource a class that does not implement javax.sql.DataSource. ...

61. looping while fetching and JDBC Connection from/to DataSource ??    forum.springsource.org

looping while fetching and JDBC Connection from/to DataSource ?? Hi, I am using Spring 2.5.4 SqlMapClientTemplate to access IBatis 2.3.4. I noticed some Oracle DB queries taking a long time. I ...

62. One Spring project, two database pools with two diff data sources    forum.springsource.org

One Spring project, two database pools with two diff data sources I am working on a Spring project that is going to need to use MYSQL and AS400/DB2.. I would like ...

63. DWR 3 with Spring3 ,DataSource is null and never gets initialized    forum.springsource.org

Nov 7th, 2011, 09:14 AM #1 Misha79 View Profile View Forum Posts Private Message Junior Member Join Date Jan 2011 Posts 15 DWR 3 with Spring3 ,DataSource is null and never ...

64. datasource property resolution error    forum.springsource.org

datasource property resolution error I am trying to load properties into the datasource via a property file. The spring documentation says this will work, but it is failing for me. Code: ...

65. DataSource suggestion    forum.springsource.org

DataSource suggestion Hi All, I need to run the batch contain more than 10 lakhs records. Total number of records are split into different list size and each list are executed ...

66. Single DataSource Connection    forum.springsource.org

Single DataSource Connection I have a funky database (actually a JDBC/ODBC driver to an ISAM file based dataset) which doesn't like repeated open / closure of DB connections. After a while ...

67. Jasper Report: pass more than one data source    forum.springsource.org

Jasper Report: pass more than one data source Rob, Please do help with this issue. I have been struggling and learning jasper report with spring 1.13 for a while with a ...

68. Difference between JNDI datasource & DriverManagerDataSo    forum.springsource.org

Does anyone know what is the recommended way to configure a datasource? Should you configure it in your app server (Tomcat, WebLogic) and access though JNDI or just use Spring's DriverManagerDataSource ...

69. runtime login to datasource    forum.springsource.org

I need to implement my datasource with login information to be obtained by getting username/password from the page only once for the first time the datasource is accessed. what is the ...

70. Publish a spring-managed DataSource to JNDI    forum.springsource.org

Publish a spring-managed DataSource to JNDI I'm using a spring managed DataSource throughout my web application. The data source is a C3P0 connection pool using the jDTS JDBC driver to connect ...

71. Petclinic datasource throws exception    forum.springsource.org

Petclinic datasource throws exception Hi all, while studying petclinic demo on JBoss 4.0.1 (HSQL runnning) it throws exceptions like: Error creating bean with name 'clinic' :x defined in ServletContext resource [/WEB-INF/applicationContext-jdbc.xml]: ...

72. Multiple DataSources question    forum.springsource.org

Multiple DataSources question I'm writing an app that will use two data sources - a data source to the primary database that will involve read/write operations, and a data source to ...

73. Connection DataSource    forum.springsource.org

Connection DataSource I'm new in Spring. I'm building a sample web application for testing this framework. I have a issue: my application start with a web form Login (implemented with JSF, ...

74. How to create a jndi using spring datasource?    forum.springsource.org

How to create a jndi using spring datasource? Hi everyone: I have not config datasource jndi in my server. But I want to use jndi to lookup datasource in jsp. I ...

75. extractDatabaseMetaData and TX datasources    forum.springsource.org

Apr 15th, 2005, 09:18 AM #1 jocsch View Profile View Forum Posts Private Message Member Join Date Nov 2004 Location Dsseldorf, Germany Posts 62 extractDatabaseMetaData and TX datasources I updated to ...

76. multiple data sources to populate model objects    forum.springsource.org

multiple data sources to populate model objects I am using 3 different data sources for my application and I am struggling to find a clean way to populate the model objects ...

77. dataSource for JasperReports subreport    forum.springsource.org

dataSource for JasperReports subreport I using in my application JasperReports. I trying pass data Beans through dataSource to the subreport (not by using SQL with parameter in WHERE clause), but all ...

78. Multiple data sources in Spring    forum.springsource.org

Hi Is there anyway of configuring multiple data sources under the same session factory or the same transaction manager? I am trying to access 2 oracle databases in 2 different machines. ...

79. JBoss DataSource not found    forum.springsource.org

May 5th, 2005, 12:00 PM #1 moacsjr View Profile View Forum Posts Private Message Junior Member Join Date Apr 2005 Location Belo Horizonte, MG - Brasil Posts 25 JBoss DataSource not ...

80. Customer Specific DataSources    forum.springsource.org

Customer Specific DataSources Hi everyone, I'm currently porting an existing web application on Tomcat over to use the Spring framework. Everything seems pretty straight forward except for one snag I have ...

81. Setting properties of JNDI Datasource    forum.springsource.org

I would like to get a Datasource via JNDI . Simple enough. But then also set the Properties of the retrieved Datasource. All via Spring Declarative Bean Configuration. Is this possible? ...

82. How to JNDI to Datasource?    forum.springsource.org

How to JNDI to Datasource? Hi, I just begin doing the project using springframework, and I successfully using the single datasource in my peoject. Since I need multiple databases, then i ...

83. Proxy DataSource    forum.springsource.org

May 19th, 2005, 09:54 PM #1 tripperm View Profile View Forum Posts Private Message Junior Member Join Date May 2005 Posts 7 Proxy DataSource From some other posts on this forum ...

84. weblogic + JNDI - unable to lookup datasource    forum.springsource.org

weblogic + JNDI - unable to lookup datasource Hi, I am getting the following message when trying to lookup datasource: ----------------------------------------------------------------------------------- org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ...

85. JNDI DataSource lookup outside of JBoss    forum.springsource.org

JNDI DataSource lookup outside of JBoss I would like to configure my DataSources in a central place and provide them to client apps via JNDI. So I've set up the JCA ...

86. Problems testing multiple dataSource context with AbstractTr    forum.springsource.org

Problems testing multiple dataSource context with AbstractTr Spring 1.2.1 Spring Mock 1.2.1 Hibernate 3.0.5 I currently have an applicationContext that has two dataSources defined. One points to a database that is ...

87. Indirect datasource property configuration    forum.springsource.org

Indirect datasource property configuration Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailin...owToAskForHelp Hibernate version:3 Name and version of the database you are using: Oracle 9i Hello all. Im trying out Hibernate ...

88. Datasource problem    forum.springsource.org

Jun 21st, 2005, 10:46 AM #1 too_many_details View Profile View Forum Posts Private Message Senior Member Join Date Feb 2005 Posts 229 Datasource problem Hi, I am writing a small utility ...

89. Using JBoss DataSource from standalone client    forum.springsource.org

Using JBoss DataSource from standalone client Hi guys! I'm having the following problem with JndiObjectFactoryBean: There's a DataSource mapped to the global namespace and i have Spring configured to use Hibernate ...

90. Initializing DataSource    forum.springsource.org

Jul 10th, 2005, 05:26 AM #1 sherihan View Profile View Forum Posts Private Message Member Join Date Jan 2005 Posts 76 Initializing DataSource Hi, I have a file named hibernate.properties file ...

91. Switching between multiple jndi data source on-the-fly    forum.springsource.org

Switching between multiple jndi data source on-the-fly Ok, I'm sure this can be done but I don't know how about to do this. I would immagine Spring has some nifty way ...

92. Problem running JUNIT test with JNDI datasource    forum.springsource.org

Problem running JUNIT test with JNDI datasource I am trying to run the junit test outside the container and having a problem running it with a jndi datasource specified in the ...

93. Multiple Data Sources    forum.springsource.org

Hi, I am wondering if there is any document or sample program that talks about multiple data sources in details. The data sources are MSSQL databases located at different locations. I ...

94. Handling many identical datasources    forum.springsource.org

I have an application that uses iBatis SqlMaps and connects to 70 remote database servers. (Its a connection monitor app) How would I best do this in Spring? I realize I ...

95. How to turn Auto Commit off when using App Server DataSource    forum.springsource.org

How to turn Auto Commit off when using App Server DataSource I've implemented a few DAO classes based on SqlQuery, SqlUpdate, etc. The DAO classes are being called by a Session ...

96. jasperreport and data source    forum.springsource.org

jasperreport and data source Dear All, I'm a newbie with spring. I have set up the CVS jasperdemo working correctly. The demo uses "databeans" to populate the jasperreports, but what I ...

97. Wiring a DataSource fails using JndiObjectFactoryBean    forum.springsource.org

Wiring a DataSource fails using JndiObjectFactoryBean I'm trying to configure my Spring MVC application to use connection pooling with a MySQL database. I have configured the DataSource in Tomcat 5.5.9 via ...

98. Configuration or LocalSessionFactoryBean with DataSource    forum.springsource.org

Aug 18th, 2005, 03:14 AM #1 mschaniel View Profile View Forum Posts Private Message Junior Member Join Date Aug 2005 Posts 3 Configuration or LocalSessionFactoryBean with DataSource When I try to ...

99. jasper reports data source definition    forum.springsource.org

jasper reports data source definition I have created a jrxml design (HTML) using Jasper Assistant. There is a queryString value, very extensive, multiple joins.... I have created a bean wtihin context ...

100. Proxied Datasource (Multiple Databases) +TheadLocal Question    forum.springsource.org

Hi all, I've read through this forum regarding this topic and I found some entries: Proxied Datasource (without Hibernate) http://forum.springframework.org/showthread.php?t=15055 Hibernate and multiple databases http://forum.springframework.org/showthread.php?t=10001 I have an app that connects ...