datasource

c# dictionary one key many values

放肆的年华 提交于 2019-11-26 15:20:31
I want to create a data store to allow me to store some data. The first idea was to create a dictionary where you have 1 key with many values, so a bit like a one to many relationship. I think the dictionary only has 1 key value. How else could I store this information? As of .net3.5+ instead of using a Dictionary<IKey, List<IValue>> you can use a Lookup from the Linq namespace: // lookup Order by payment status (1:m) // would need something like Dictionary<Boolean, IEnumerable<Order>> orderIdByIsPayed ILookup<Boolean, Order> byPayment = orderList.ToLookup(o => o.IsPayed); IEnumerable<Order>

How to use encrypted password in apache BasicDataSource?

走远了吗. 提交于 2019-11-26 12:13:00
问题 At present i am keeping the password [ unencrypted ] in a property file. This password get placed as is in the configuration xml using ant. [ The configuration xml is for datasource, it is creating the object of dbcp.BasicDataSource ] Now, is it possible that after the ant target the password is copied in encrypted form. Heard the Jasypt can do that! Till now i haven\'t tried this. But, the problem doesn\'t end here. BasicDataSource do not accept encrypted password. Is there any replacement

Unable to find the requested .Net Framework Data Provider in Visual Studio 2010 Professional

雨燕双飞 提交于 2019-11-26 11:08:49
问题 Why am I getting \"Unable to find the requested .Net Framework Data Provider\" when trying to setup a new datasource in Visual Studio 2010 Professional? My stats: Windows 7 64bit 16gig RAM Visual Studio 2010 Professional SQL Server 2008 (server A, full admin rights) SQL Server 2008 (server B, full admin rights) I have started a test ASP.NET application and when I try to add a new data source, I get: Unable to find the requested .Net Framework Data Provider. It may not be installed. I have

How to connect to a MySQL Data Source in Visual Studio

做~自己de王妃 提交于 2019-11-26 09:09:06
问题 I use the MySQL Connector/Net to connect to my database by referencing the assembly (MySql.Data.dll) and passing in a connection string to MySqlConnection . I like that because I don\'t have to install anything. Is there some way to \"Choose Data Source\" in Visual Studio 2010 without installing something? How can I get a MySQL option (localhost) to show up on one of these lists? Or do I have to install something? (I don\'t want to use ODBC btw) \"Add Connection\" from Server Explorer: Entity

What&#39;s the difference between data source and delegate?

青春壹個敷衍的年華 提交于 2019-11-26 08:09:23
问题 I have a fundamental question related to Cocoa frameworks design patterns. What\'s the difference between delegate and data source? Both of them could use @protocols declaration, but some classes or frameworks are using delegate , and some others are using datasource . All I can understand from UI/NSTableView is the delegate respond to UI-related events, while the datasource is purely related to the data. But, I don\'t know any data source implementations outside the UI classes of Cocoa. Note

tomcat7 - jdbc datasource - This is very likely to create a memory leak

独自空忆成欢 提交于 2019-11-26 07:29:35
问题 I get the following messages in catalina.out log file when tomcat is shutdown. I am using Tomcat 7.x and the Tomcat JDBC data source. Mar 26, 2013 1:17:52 PM org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc SEVERE: The web application [/my_webapp] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. Mar 26, 2013 1:17:52 PM org.apache

Externalizing Grails Datasource configuration

拟墨画扇 提交于 2019-11-26 07:27:28
问题 Grails 1.x allows using external configuration files by setting the grails.config.locations directive. Is there a similar approach available for externalizing the database configuration in Datasource.groovy (without setting up JNDI)? It would prove helpful to be able to configure DB credentials in a simple configuration file outside the application. Thanks in advance! 回答1: You can use a properties file specified in the grails.config.locations as a way to externalize the datasource

How to pass main report data source to subreport (JasperReports)?

自古美人都是妖i 提交于 2019-11-26 06:37:58
问题 I\'m using JasperReports and I fill the JRDataSource for ther report. Now, I want to pass the main REPORT_DATA_SOURCE to the subreport. How can I do this? As far as I know the REPORT_DATA_SOURCE is a consumable object, so it can only be used once, right?. Can I copy this data source and pass it? BTW: I use iReport for creating the layout. 回答1: You can pass datasource via the built-in REPORT_DATA_SOURCE parameter. The example: <subreport> <reportElement x="261" y="25" width="200" height="100"/

How to test a mocked JNDI datasource with Spring?

帅比萌擦擦* 提交于 2019-11-26 06:25:00
问题 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 a JNDI context from tomcat to retrieve a connection and via that connection retrieves data from a database. So I guess I need to mock the JNDI calls and the data retrieval. Any good pointers on what the best way to tackle this would be great! Thanks a lot! 回答1: I usually define my JNDI dependencies in seperate file, like

c# dictionary one key many values

浪尽此生 提交于 2019-11-26 05:54:12
问题 I want to create a data store to allow me to store some data. The first idea was to create a dictionary where you have 1 key with many values, so a bit like a one to many relationship. I think the dictionary only has 1 key value. How else could I store this information? 回答1: As of .net3.5+ instead of using a Dictionary<IKey, List<IValue>> you can use a Lookup from the Linq namespace: // lookup Order by payment status (1:m) // would need something like Dictionary<Boolean, IEnumerable<Order>>