datasource

Adding datasource programmatically to JNDI context in embedded tomcat 7

孤者浪人 提交于 2019-12-07 10:36:22
问题 I'm trying to register a new datasource before the server starts but on lookup execution I'm getting javax.naming.NameNotFoundException: Name [jdbc/db] is not bound in this Context. Unable to find [jdbc]. This is how I start tomcat: Tomcat tomcat = new Tomcat(); //... ContextResource resource = new ContextResource(); resource.setName("jdbc/db"); resource.setAuth("Container"); resource.setType("javax.sql.DataSource"); resource.setScope("Sharable"); resource.setProperty("driverClassName", "org

Creating XA DataSource to DB2 on JBoss

痞子三分冷 提交于 2019-12-07 10:34:49
问题 I trying to configure an XA DB2 DataSource, xa-datasource (based on http://community.jboss.org/wiki/SetUpADB2Datasource) using com.ibm.db2.jcc.DB2XADataSource class ( local-tx-datasource works using the com.ibm.db2.jcc.DB2Driver ). The target server is DB2 Connect V9.7 Actual xa-datasource config: <xa-datasource> <jndi-name>jdbc/DB2ServerDS</jndi-name> <use-java-context>false</use-java-context> <track-connection-by-tx>true</track-connection-by-tx> <xa-datasource-class>com.ibm.db2.jcc

how to bind datasource to List<Dictionary<string, string>>?

穿精又带淫゛_ 提交于 2019-12-07 09:23:46
问题 I have a class that stores a list of dictionary entries. I want bind that to a datasource for gridview from codebehind. Code for dictionary type of , representing ErrorMessage and failed field. public partial class FailedFields { private Dictionary<string, string> Code_Error = new Dictionary<string, string>(); public void AddFailedField(string field, string message) { Code_Error.Add(field, message); } public Dictionary<string, string> GetFailedFields() { return Code_Error; } } Code for List

Bind List to DataSource

偶尔善良 提交于 2019-12-07 01:07:46
问题 I want to be able to bind a list to a listbox datasource and when the list is modified, the listbox's UI automatically updated. (Winforms not ASP). Here is a sample : private List<Foo> fooList = new List<Foo>(); private void Form1_Load(object sender, EventArgs e) { //Add first Foo in fooList Foo foo1 = new Foo("bar1"); fooList.Add(foo1); //Bind fooList to the listBox listBox1.DataSource = fooList; //I can see bar1 in the listbox as expected } private void button1_Click(object sender,

KendoUI datasource group and aggregate by multiple fields

孤街醉人 提交于 2019-12-06 23:13:23
I'm trying to group a datasource by two fields and get the average or sum of their values. But even if I specify both group and aggregate properties in the datasource, I can't get it. Here is the code: var dataSource = new kendo.data.DataSource({ data: [ { id: 1, name: "Amazon US", stock: 15, year: 2015}, {id: 2,name: "Amazon US", stock: 20, year: 2016 }, {id: 3,name: "Amazon US", stock: 7, year: 2016 }, { id: 4, name: "Amazon EU", stock: 30, year: 2015 }, { id: 5, name: "Amazon EU", stock: 7, year: 2015 }, { id: 6, name: "Amazon EU", stock: 12, year: 2016 }, { id: 7, name: "Amazon EU", stock:

https login page with curl

℡╲_俬逩灬. 提交于 2019-12-06 22:51:36
I can't get php curl to work. I need to log in to a page and then get the source code for a page right after login. <?php //user login information $username = ""; $password = ""; $submit = "Login"; //server link and variables $url ="https://orapp2.hunter.cuny.edu/sims/cls.MySchedule.login"; $nameField ="p_login_name"; $passField ="p_passwd"; $subField ="Login"; $cookie_file = "/tmp/cookie.txt"; $page = curl_init($url); curl_setopt($page , CURLOPT_POST, 1); $postData = $nameField."=".$username."&".$passField."=".$password."&".$subField."=".$submit; curl_setopt($page, CURLOPT_POSTFIELDS,

How to externalize properties of persistence.xml for JBOSS 7.1.1?

筅森魡賤 提交于 2019-12-06 16:28:29
My persistence.xml is currently present in the application war(in META-INF folder.). However, for the application to be run across multiple DBs the persistence needs to be changed again and again. I want to avoid it. But, I am not able to understand how will i configure the properties(like dialect) in the persistence.xml from, say, a property file which i would change based on my DB, hence not compelling me to update and redeploy my war. My problem can also be resolved if i can configure the dialect in the datasource in standalone.xml where i have mentioned other DB details. I am not being

Modularization of Jasper reports: Pass data source to subreport without unnecessary db roundtrips?

我的梦境 提交于 2019-12-06 15:54:14
问题 In this thread how-to-pass-main-report-data-source-to-subreport-jasperreports it is stated that there may be problems with subreports on reusing an existing master reports data source . It says the subreport may close the datasource prematurely (before other iterations calling the subreports may be processed). It seems that this may be my problem because the report is always generated (without an error) ... ok: using the connection from the master report (thus each time executing the query

smartgwt listgrid RestDataSource not populating

半城伤御伤魂 提交于 2019-12-06 15:42:47
问题 Im new using this front end framework application... I recently started to work with smartgwt and i'm bulding a new application with a Spring MVC integration. I'm using a ListGrid with a RestDataSource (Consume the Rest service with mvc:annotation-driven for plain JSON) I can see that the servaice gets consuming properly perhaps my grid is never shown with the data in it. Can someone help me here ? Here's my ListGrid class public class ListGrid extends com.smartgwt.client.widgets.grid

What's the most efficient way to handle a UIButton Photo Grid in a UITableView?

陌路散爱 提交于 2019-12-06 14:52:53
问题 I have an iOS app I'm working on that grabs a bunch of photo URLs from a MySQL database with a JSON request. Once I have these photos and related information, I use it to populate the datasource for a UITableView. I want to create a grid of UIButtons, made out of photos, 4 per row. This current code works, however it is wildly slow and my phone / simulator freezes right up as I scroll through the table. Tables with only a couple rows work fine, but once I reach 10 or more rows it slows right