datasource

running Spring Boot for REST

萝らか妹 提交于 2019-12-13 17:22:51
问题 I created a spring boot application with Rest Controller and Oracle on my local system, thru IDE its running fine, the mvn build was fine package was also good but if I run it as executable jar I am getting the below error. I have application.properties in which I have provided all spring.datasource, but here I am getting error. Please advise. org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.boot.autoconfigure.orm.jpa

Liferay/Tomcat “hot-deploy” closes JNDI connection, how can I keep it open?

北城余情 提交于 2019-12-13 16:32:26
问题 First, I'm not sure if the behavior comes from Liferay or Tomcat. I have a portlet in Liferay that uses a JNDI connection and JDBC template all configured with spring (I'm not using Liferay service builder or anything from Liferay, I'm just using it as a portlet container). When I start the server, the JNDI connection works (I'm able to retreive data from a database). When I "hot deploy" my portlet WAR in liferay, the connection is closed. So when I try to access the data, I get this error :

Deselect combobox item

陌路散爱 提交于 2019-12-13 16:19:28
问题 I have a databound combobox: using(DataContext db = new DataContext()) { var ds = db.Managers.Select(q=> new { q.ManagerName, q.ManagerID}); cmbbx_Managers.BindingContext = new BindingContext(); cmbbx_Managers.DataSource = ds; cmbbx_Managers.DisplayMember = "ManagerName"; cmbbx_Managers.ValueMember = "ManagerID"; } When the form loads neither item is selected, but when the user chooses an item it cannot be deselected. I tried to add cmbbx_Managers.items.Insert(0, "none") , but it does not

can I have 2 different datasources in groovy with different privileges

折月煮酒 提交于 2019-12-13 15:32:59
问题 I was wondering if we can have 2 datasources configured in a Grails application, I want one to have readonly access (select) and the other to have read-write access (create, insert, update..) 回答1: For pre-2.0 apps use http://grails.org/plugin/datasources/ and for 2.0 it's built into Grails - see the docs at http://grails.org/doc/2.0.0.RC1/guide/conf.html#multipleDatasources 回答2: Yes you can but - from my experience - with some conditions/limitations that you should be aware of. Know this:

How do I implement getConnection() in DataSource in Java?

眉间皱痕 提交于 2019-12-13 14:17:11
问题 I'm reading up on DataSource, here, and trying to implement it in my own little project by using a simple file as my "data source". I've created a class that is pretty simple at the moment... public class QueueData implements DataSource { ... } though the reason it is simple is because I haven't been able to find a resource that explains how the implemented methods should work. Everyone seems to just list the initialization of a context and a magical getConnection() call, like so. Context ctx

Spring autowire null pointer exception [duplicate]

丶灬走出姿态 提交于 2019-12-13 10:01:26
问题 This question already has answers here : Why is my Spring @Autowired field null? (16 answers) Closed 2 years ago . xml configuration - <bean id="DS" class="org.springframework.jdbc.datasource.DriverManagerDataSource" > <property name="driverClassName" value="${DB.DRIVERCLASS}" /> <property name="url" value="${TABLEMAINT.URL}" /> <property name="username" value="${TABLEMAINT.USER}" /> <property name="password" value="${TABLEMAINT.PASSWORD}" /> </bean> @Component class AbcDAO{ @Autowired

The method getConnection() is undefined for the type DataSource

Deadly 提交于 2019-12-13 07:16:58
问题 I am connecting to an oracle database using a connection pool. I have set up my datasource file but when I try to get a connection I get the error The method getConnection() is undefined for the type DataSource I have searched the internet and it doesn't seem to be a common problem. I am not sure what I have done wrong. The code is: <datasources> <local-tx-datasource> <jndi-name>DefaultDS</jndi-name> <connection-url>jdbc:oracle:thin:@ED.OPTO:1521:OPY> <driver-class>oracle.driver.OracleDriver<

Close connection to DB does not close all connections

冷暖自知 提交于 2019-12-13 06:44:55
问题 I have connection leak to DB in my code. The funny thing is that when I debug, all the connections are closed successfully (or when I do Thread.Sleep(100) ). but without that there is always one connection that stays! Can you tell what is the problem here? ComboPooledDataSource dataSource = null; try { dataSource = dataSourceFactory.getDataSource(dbType, dbProps); dataSource.getConnection(); } finally { if (dataSource != null) { try { log.debug("validate() : Closing SQL connection pool");

MSTest data driven rows are cast to ints

痞子三分冷 提交于 2019-12-13 06:20:28
问题 I have a data driven test (using MSTest) that has inputs that look like this: ValuesToInput,ExpectedValue 0,0 00,00 000,000 0000,000 00000,000 000000,000 When I pull those out of my TestContext they are just 0. It has converted my string of 0000 to an int and gives me 0. How can I make it give me my values as strings? NOTE: My test method is setup like this: [TestCategory("CodedUI"), DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", "MyCvsFile.csv", "MyCvsFile#csv",

KendoCombobox is not fetching Localsource jsondata

大兔子大兔子 提交于 2019-12-13 05:17:22
问题 I am using KendoUi for my project. i created local wcf service and it works well. i tested on the browser and it gives jsondata. but i cannot fetch the data to the aspx page in combobox. my javascript code for the kendocombobox is below. please help me as soon as possible. please use localhost in place of www.google.com var ds = new kendo.data.DataSource({ transport: { type: "json", read: { url: "http://www.google.com:2608/Service1.svc/getAllProducts" } }, aggregate: [{ field: "ProductID",