datasource

Unable to define oracle datasource on Jboss AS 7

不问归期 提交于 2019-12-04 03:27:58
问题 I'm using Jboss AS 7.1.1.final and I'm trying to add an oracle Datasource: <datasource jndi-name="java:jboss/datasources/DefaultDS" pool-name="DefaultDS" enabled="true" use-java-context="true"> <connection-url>jdbc:oracle:oci@TNS_NAME</connection-url> <driver>oracle</driver> <security> <user-name>username</user-name> <password>pwd</password> </security> </datasource> And the driver: <driver name="oracle" module="com.oracle.ojdbc"> <xa-datasource-class>oracle.jdbc.OracleDriver</xa-datasource

How to Casting DataSource to List<T>?

Deadly 提交于 2019-12-04 03:01:57
问题 I have the following method that load products on a DataGridView private void LoadProducts(List<Product> products) { Source.DataSource = products; // Source is BindingSource ProductsDataGrid.DataSource = Source; } And now I'm trying to give me back to save them as shows below. private void SaveAll() { Repository repository = Repository.Instance; List<object> products = (List<object>)Source.DataSource; Console.WriteLine("Este es el número {0}", products.Count); repository.SaveAll<Product>

What is the replacement for TestContext.DataRow[“MyColumnName”]

坚强是说给别人听的谎言 提交于 2019-12-04 03:01:21
Using MSTest in a .Net Core Unit test project. I am attempting to use a csv datasource to provide the data for a test method. Previously, I would use something like below in a .Net Framework test project: [DataSource("Microsoft.VisualStudio.TestTools.DataSource.CSV", @"data.csv", "data#csv", DataAccessMethod.Sequential), DeploymentItem("data.csv"), TestMethod] public void ValuesController_Post() { _controller.Post(TestContext.DataRow["body"]); _valuesRepository.Verify(_ => _.Post(It.IsAny<string>()), Times.Once); } The key here being the DataRow property found in TestContext. This doesn't

Should I close JNDI-obtained data source?

谁说我不能喝 提交于 2019-12-04 00:53:51
问题 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 get a data source this way: <bean id="dataSource" class="my.data.Source" destroy-method="close"> <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/> <property name="url" value="jdbc:oracle:thin:@localhost:1521:home"/> <property name

Run SQL statement at beginning of each DB connection in Spring Boot

ε祈祈猫儿з 提交于 2019-12-03 21:53:33
问题 How can I run a custom SQL statement directly after obtaining a DB connection with Spring Boot? The SQL needs to be run each time a new connection is established. The solution should work with the Spring Boot default DataSource implementation (which I think is a Tomcat pooling data source). It doesn't really matter what the statement is, but in my case it will be ALTER SESSION SET CURRENT_SCHEMA=xxxx 回答1: Tomcat Jdbc Connection pool has a parameter "initSQL" https://tomcat.apache.org/tomcat-7

Configure JDBC driver in JBoss 7 - as a deployment OR as a module?

我们两清 提交于 2019-12-03 21:18:17
As mentioned in the article https://community.jboss.org/wiki/DataSourceConfigurationInAS7 JBoss 7 provides 2 main ways to configure a data source. What is the BEST practice of configuring a data source in JBoss 7 AS ? Is it As a module? As a deployment? (The same question has been asked in the thread https://community.jboss.org/thread/198023 , but no one has provided an acceptable answer yet.) The guide JBoss AS7 DS configuration says the recommended way is to configure the datasource by deployment But according to discussion on the link Jboss 7 DS configuration JBoss Community Discussion on

spring - how to autowire data source?

孤人 提交于 2019-12-03 21:02:54
I'm having some problem with autowire and DI in general, so I hope that someone can help cause I've been stuck for days now. This is the code: @Service public class TicketsController implements Controller { private TicketManager ticketManager; @Autowired public void setTicketManager(TicketManager ticketManager) { this.ticketManager = ticketManager; } ... } @Service public class SimpleTicketManager implements TicketManager { private TicketsDao ticketsDao; @Autowired public void setTicketsDao(TicketsDao ticketsDao) { this.ticketsDao = ticketsDao; } ... } @Repository public class JdbcTicketDao

c# Hide a property in datagridview with datasource [duplicate]

≡放荡痞女 提交于 2019-12-03 19:17:15
问题 This question already has answers here : Is there an Attribute I can use in my class to tell DataGridView not to create a column for it when bound to a List<MyClass> (3 answers) Closed 5 years ago . I think there must be an attribute to hide a public property from the datagridview. But I can't find it. 回答1: If you are adding the columns yourself... don't add the columns you don't want. If you have AutoCreateColumns enabled, then: if it is a class-based model, add [Browsable(false)] to

Kendo Ui DataSource Add Function not working properly

我的梦境 提交于 2019-12-03 17:17:41
I defined a Kendo Data Source as below. It is populating values in a ListView. var datasourceAppList = new kendo.data.DataSource({ transport: { create: function(options){ //alert(options.data.desc); alert(options.data.desc); var localData = JSON.parse(localStorage.getItem("LsAppList")); localData.push(options.data); localStorage.setItem("LsAppList", JSON.stringify(localData)); //localStorage["LsAppList"] = JSON.stringify(localData); options.success(localData); }, read: function(options){ var localData = JSON.parse(localStorage["LsAppList"]); options.success(localData); }, update: function

Bind DataTable to RDLC and ReportViewer

独自空忆成欢 提交于 2019-12-03 16:59:10
I have read every single SO question and online article regarding this, and I get confused in a couple different instances. As my project sits, I have tried to create a Report ( Report2.rdlc ) manually and drag different fields from DataSources onto the report, and use that report as the data source for the ReportViewer . This did not work. I need to use the DataTable I created from a SqlDataAdapter because it decrypts specific rows. I tried creating a DataSet and filling it with the DataTable , however I was unable to perform that, also. I don't understand: if I have a ReportViewer control on