datasource

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

风格不统一 提交于 2019-12-08 07:53:03
问题 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

ComboBox doesn't load users

血红的双手。 提交于 2019-12-08 07:52:49
问题 private void LoadUsersToComboBox() { comboBox1.DataSource = null; comboBox1.DataSource = peopleRepo.FindAllPeople(); /*Returns IQueryable<People>*/ comboBox1.DisplayMember = "Name"; comboBox1.ValueMember = "ID"; } private void button2_Click(object sender, EventArgs e) { CreateNewPerson(); LoadUsersToComboBox(); } private void CreateNewPerson() { if (textBox2.Text != String.Empty) { Person user = new Person() { Name = textBox2.Text }; peopleRepo.Add(user); peopleRepo.Save(); } } I'd like the

java.sql.SQLException: No suitable driver [duplicate]

旧街凉风 提交于 2019-12-08 07:50:39
问题 This question already has answers here : The infamous java.sql.SQLException: No suitable driver found (13 answers) Closed 3 years ago . I have create one maven project. I am try to connect MSSQL (Microsoft SQL Server 2014) with my J2EE application. But it throws following exception org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452) at org

Create Datasource Hive on Pentaho hadoop

烈酒焚心 提交于 2019-12-08 06:35:58
问题 I try pentaho hadoop to make report designer with Hive Datasource. I have make connection to hadoop with connection url: jdbc:hive://localhost:10000 and driver class name :org.apache.hadoop.hive.jdbc.HiveDriver Then I create datasource which I pointed to Hive database to access Table inside. And then when I make design the report and drag field of table to designer workspace there is and error message An unexpected error has occurred: The generated SQL-query did not execute successfully. in

https login page with curl

不羁岁月 提交于 2019-12-08 04:32:03
问题 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

access denied when trying to connect to mysql using tomcat datasource

江枫思渺然 提交于 2019-12-08 04:13:08
问题 I'm trying to connect locally to mysql 5 server in jsp page using tomcat 6 and datasource. I've configured everything as in the tomcat manual (web.xml, context.xml, etc.), but I get this exception: java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve) I checked the mysql and there is no problem with the connection itself, in fact I even succeeded connecting using direct JDBC connection (i.e. without using

Filter data grid view list with the value from the search text box: 'Object reference not set to an instance of an object.'

倾然丶 夕夏残阳落幕 提交于 2019-12-08 03:45:16
问题 I have set up a text box to search names on my data grid but I am receiving the error: 'Object reference not set to an instance of an object.' List<Member> members = new List<Member>(); public class Member { public int id { get; set; } public string name { get; set; } public int age { get; set; } public Image image_url { get; set; } } // In a keyup event of the text box (memberGrid.DataSource as DataTable).DefaultView.RowFilter = string.Format("name = '{0}'", searchBox.Text); I have attempted

Inserting rows into a database in ASP.NET

心不动则不痛 提交于 2019-12-08 03:35:03
问题 I am new to .NET, and I'm can't seem to figure out something that should be simple. I want to insert a row into a table, and initialize it with values that aren't bound to data controls. Specifically, I have a CreateUserWizard control on a page. In the CreatedUser method, I want to insert a row into a databse I created called "users" that contains the Username and the Email address from the CreateUserWizard control, and the date the new user was created, from the DateTime.Now function. There

Property 'dataSource' is required Error in java (Spring)

余生长醉 提交于 2019-12-08 03:26:21
问题 I am developing an web application in Java (Spring) My java file is as, try { JdbcTemplate jt = new JdbcTemplate(dataSource); System.out.println("Connection ....."+jt.toString()); Connection conn; Statement st; conn =DriverManager.getConnection(jt.toString()); conn = (Connection) jt.getDataSource(); st=conn.createStatement(); System.out.println("Connection created....."+st); } catch (Exception e) { System.out.println("Error Found...."+ e.getMessage()); System.out.println("Strack Trace....."+e

access denied when trying to connect to mysql using tomcat datasource

一世执手 提交于 2019-12-08 03:11:27
I'm trying to connect locally to mysql 5 server in jsp page using tomcat 6 and datasource. I've configured everything as in the tomcat manual (web.xml, context.xml, etc.), but I get this exception: java.net.SocketException: java.security.AccessControlException: access denied (java.net.SocketPermission 127.0.0.1:3306 connect,resolve) I checked the mysql and there is no problem with the connection itself, in fact I even succeeded connecting using direct JDBC connection (i.e. without using datasource). Do I need to set anything in the tomcat policy file? other ideas? Thanks I found a workaround,