dynamically change Spring data source

You can use spring’s AbstractRoutingDataSource by extending it and overriding the method determineCurrentLookupKey() that should return the key referencing the datasource’s spring bean to be used. Take a look at this blog article on spring source’s blog which will show you an example of how to use that feature. Basically to answer your questions, what … Read more

Externalizing Grails Datasource configuration

You can use a properties file specified in the grails.config.locations as a way to externalize the datasource configuration. Below is how I typically set up a Grails project: In my DataSource.groovy I specify this for the production environment: …. …. production { dataSource { dbCreate = “update” driverClassName = “com.myorg.jdbcDriverNotExists” url = “” username = … Read more

Multiple Combo Boxes With The Same Data Source (C#)

probably you could also try this solution, just assign a new Context to the 2nd combo box: combobox1.DataSource = results; combobox1.DisplayMember = “DisplayValue”; combobox1.ValueMember = “Value”; combobox2.BindingContext = new BindingContext(); //create a new context combobox2.DataSource = results; combobox2.DisplayMember = “DisplayValue”; combobox2.ValueMember = “Value”; Thank you

Using a list as a data source for DataGridView

First, I don’t understand why you are adding all the keys and values count times, Index is never used. I tried this example : var source = new BindingSource(); List<MyStruct> list = new List<MyStruct> { new MyStruct(“fff”, “b”), new MyStruct(“c”,”d”) }; source.DataSource = list; grid.DataSource = source; and that work pretty well, I get two … Read more

Add a spinner when Mat-table is loading?

table.component.html <table mat-table [dataSource]=”dataSource” class=”mat-elevation-z8″> <!– table here …–> <tr mat-header-row *matHeaderRowDef=”displayedColumns”></tr> <tr mat-row *matRowDef=”let row; columns: displayedColumns;”></tr> </table> <div *ngIf=”isLoading” style=”display: flex; justify-content: center; align-items: center; background: white;”> <mat-progress-spinner color=”primary” mode=”indeterminate”> </mat-progress-spinner> </div> table.component.ts isLoading = true; dataSource = null; ngOnInit() { this.annuairesService.getMedecins() subscribe( data => { this.isLoading = false; this.dataSource = data }, … Read more

React-Native Updating List View DataSource

Try this: pressRow(rowData){ var newDs = []; newDs = this.state.ds.slice(); newDs[0].Selection = newDs[0] == “AwayTeam” ? “HomeTeam” : “AwayTeam”; this.setState({ dataSource: this.state.dataSource.cloneWithRows(newDs) }) } This should make a copy of the array, which can then be modified independently of the original array in this.state.ds.

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

You can pass datasource via the built-in REPORT_DATA_SOURCE parameter. The example: <subreport> <reportElement x=”261″ y=”25″ width=”200″ height=”100″/> <dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}]]></dataSourceExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + “subreport.jasper”]]></subreportExpression> </subreport> You can create new instance of datasource based on variable, parameter or field. The sample: <variable name=”HeadingsCollection” class=”java.util.Collection” calculation=”System”> <initialValueExpression><![CDATA[new java.util.ArrayList()]]></initialValueExpression> </variable> … <subreport> <reportElement x=”0″ y=”0″ width=”515″ height=”20″/> <subreportParameter name=”ReportTitle”> <subreportParameterExpression><![CDATA[$P{ReportTitle}]]></subreportParameterExpression> </subreportParameter> … Read more

HikariPool-1 – Connection is not available, request timed out after 30000ms for very tiny load server

Your database is not obtaining connection within (30000 milliseconds that is default connectionTimeout property) because of network latency or some of the queries which are taking too long to execute(more than 30000 milliseconds). Please try to increase value of property connectionTimeout. YML configuration example: spring: datasource: hikari: minimumIdle: 2 maximumPoolSize: 10 idleTimeout: 120000 connectionTimeout: 300000 … Read more

Object persistence terminology: ‘repository’ vs. ‘store’ vs. ‘context’ vs. ‘retriever’ vs. (…)

As noone has yet answered the question, I’ll post on what I have decided in the meantime. Just for the record, I have pretty much decided on calling most data store classes repositories. First, it appears to be the most neutral, non-technical term from the list I suggested, and it seems to be well in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)