datasource

is javax.sql.DataSource thread safe?

蹲街弑〆低调 提交于 2019-11-27 03:29:45
问题 I am using the PostgreSQL 9.1 JDBC4 driver (postgresql-9.1-902.jdbc4.jar) in a Java EE application deployed in JBoss 7. Can I assume that javax.sql.DataSource is thread-safe so that multiple threads can concurrently call the getConnection() method on it? 回答1: javax.sql.DataSource itself is an interface, so it is a specific to the implentation if it is thread-safe or not. For the postgres sql driver, I recommend that you read Chapter 10. Using the Driver in a Multithreaded or a Servlet

Unable To set row visible false of a datagridview

末鹿安然 提交于 2019-11-27 01:57:53
I have a DataGridView where I set DataSource : taskerEntities te = new taskerEntities(); var OMsMasterDescriptiveIndicators = te.MyTable.Select(x => new lccls {Id = x.Id, name = x.name }).ToList(); MyGrid.DataSource = OMsMasterDescriptiveIndicators; with my class lccls as public class lccls { public string Id { get; set; } public Nullable<decimal> name { get; set; } } At a certain event I want to make the current row invisible: MyGrid.Rows[5].Visible = false; But I am unable to do this. Instead an exception is thrown with the following error message: Row associated with the currency manager's

Angular Material Table Dynamic Columns without model

孤街醉人 提交于 2019-11-27 01:54:39
问题 I need to use angular material table without model, because I don't know what will come from service. So I am initializing my MatTableDataSource and displayedColumns dynamically in component like that : TableComponent : ngOnInit() { this.vzfPuanTablo = [] //TABLE DATASOURCE //GET SOMETHING FROM SERVICE this.listecidenKisi = this.listeciServis.listecidenKisi; this.listecidenVazife = this.listeciServis.listecidenVazife; //FILL TABLE DATASOURCE var obj = {}; for (let i in this.listecidenKisi ){

How to Define a MySql datasource bean via XML in Spring

回眸只為那壹抹淺笑 提交于 2019-11-27 01:53:23
问题 I've looked over the documentation to define a bean. I'm just unclear on what class file to use for a Mysql database. Can anyone fill in the bean definition below? <bean name="dataSource" class=""> <property name="driverClassName" value="" /> <property name="url" value="mysql://localhost/GameManager" /> <property name="username" value="gamemanagertest" /> <property name="password" value="1" /> </bean> 回答1: Both the answers are appropriate for the question. But just for an FYI if you're going

Multiple data source and schema creation in Spring Boot

霸气de小男生 提交于 2019-11-27 01:48:07
问题 I'm using Spring Boot. I finally managed to setup two data sources, but now I'm facing another issue. with two data sources in place spring.jpa.hibernate.ddl-auto=create seems to stop working in my spring boot application, only spring.jpa.generate-ddl=true do the job now I can not manage to select the auto-creation strategy for each of the data sources. I would prefer to create the schema for data source one, and just use the created schema in second DB with data source two. Any body have

Custom column names for DataGridView with associated DataSource

耗尽温柔 提交于 2019-11-27 01:48:02
问题 How can I setup custom column names for DataGridView with associated DataSource? Here is some code: class Key { public string Value { get; } public DateTime ExpirationDate { get; } } List<Key> keys = new List<Key>(); ...// fill keys collection DataGridView dataGridView = createAndInitializeDataGridView(); dataGridView.DataSource = keys; This gives me dataGridView with column names "Value" and "ExpirationDate". How should I proceed to change names to "Key" and "Expire" for example? 回答1: Use

How can I bind a DataSource to an InitialContext for JUnit testing? [duplicate]

我与影子孤独终老i 提交于 2019-11-27 01:02:07
问题 This question already has answers here : Setting up JNDI Datasource in jUnit (6 answers) Closed 3 years ago . I'm trying to run JUnit tests on database "worker" classes that do a jndi lookup on an InitialContext to get a DataSource . The worker classes are usually running on a Glassfish v3 App Server which has the appropriate jdbc resources defined. The code runs just fine when deployed on the App Server but doesn't run from the JUnit testing environment, because obviously it can't find the

data sources derby - connection refused

怎甘沉沦 提交于 2019-11-26 22:58:44
问题 I am trying to connect a database with a java project. After reading some tutorials and the course support, I have understood that I need to make a new data source under the Admin Console. So, I've logged in into the admin console, then navigated to Resources -> JDBC -> Data Sources -> New; filled in the fields and when I am testing the connection, the error I get is this one: Messages The test connection operation failed for data source MyDB on server server1 at node RO2CVG6CNode01 with the

How to connect to a MySQL Data Source in Visual Studio

倖福魔咒の 提交于 2019-11-26 22:28:29
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 Data Model Wizard: Visual Studio requires that DDEX Providers (Data Designer Extensibility) be registered by

Sending an email with an attachment using javamail API

半世苍凉 提交于 2019-11-26 21:37:56
问题 I am trying to send an email with an attachment file in Java. When I send the email without an attachment I receive the email, but when I add the attachment I don't receive anything and I don't get any error messages. This is the code I am using: public void send () throws AddressException, MessagingException{ //system properties Properties props = new Properties(); props.put("mail.smtp.localhost", "localhost"); props.put("mail.smtp.host",Configurations.getInstance().email_serverIp); /* *