datasource

Omit schema in the DERBY Query

假如想象 提交于 2019-11-28 13:42:47
I have created a database named 'movie_db', set default schema to APP. Then created a sample table named 'USERS'. My connection to DB is as follows: <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/> <property name="url" value="jdbc:derby://localhost:1527/movie_db"/> <property name="username" value="root"/> <property name="password" value="pass"/> </bean> Now I want to write some tests and try to execute the following query: SELECT * FROM USERS; What I get: java.sql

Firebase database Not equal request - Alternative solution (for iOS)

醉酒当歌 提交于 2019-11-28 13:04:23
I am using Firebase database with a Json structure to manage users' comments. { "post-comments" : { "post-id-1" : { "comment-id-11" : { "author" : "user1", "text" : "Hello world", "uid" : "user-id-2" },.... } I would like to pull all the comments but excluding the current user's one. In SQL this will be translated into: Select * from post-comments where id !="user-id-2" I understand that Firebase database does not offer a way to excludes nodes based on the presence of a value (ie: user id != ...). Thus is there any alternative solutions to tackle this. Either by changing the Database structure

java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver : Am I loading the right driver?

人盡茶涼 提交于 2019-11-28 12:48:08
When I run the following snippet to connect to datasource to get the data out through queries : try { String driver = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; Class.forName(driver); String Url = "jdbc:sqlserver://localhost:1433;databaseName=movies"; Connection connection = DriverManager.getConnection(Url,"sa", "xxxxxxx); // Context initContext = new InitialContext(); // Context envContext = (Context)initContext.lookup("java:comp/env"); // DataSource ds = (DataSource)envContext.lookup(""); // Connection connection = ds.getConnection(); String query_name = "select name from list where

Where should the JDBC driver JAR files reside on a Tomcat deployment with a datasource?

纵饮孤独 提交于 2019-11-28 12:22:05
I have java web application using Spring, Hibernate, Tomcat7 & MySql. I use Datasource for database operations. I am not very clear about what is the standard location to load the jar files ( Tomcat-jdbc.jar & Mysql-connector.jar ) from? It works if I keep BOTH the jars either in CATALINA_HOME/lib/ or webapps/myApp/WEB-INF/lib . But I was told to use only the Tomcat-jdbc from CATALINA_HOME/lib/ and mysql-connector.jar from /WEB-INF/lib/ , which gives a ClassNotFound Exception for Sql Driver . Can someone let me know which is the right location for these jars? <bean id="dataSource" class="org

How to properly keep a DB connection from a Connection Pool opened in JBoss

喜夏-厌秋 提交于 2019-11-28 11:32:57
问题 I'm using JBoss AS 7.1 as a server and I have my DataSource configured with pooling. I'm quite new to this so please excuse any rookie mistakes... after all I'm here to learn. When a client logs-in it gets a connection to the database and I need to keep that connection(from the pool) open until the user logs-out or the HttpSession expires. This is an absolute requirement coming from our DB Admin. who says that he needs the DB session variables. I am using a servlet for all this. Playing with

is javax.sql.DataSource thread safe?

▼魔方 西西 提交于 2019-11-28 10:04:06
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? 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 Environment from the official documentation: The PostgreSQL JDBC driver is thread safe. [...] Ian Roberts Typically

JasperReports Server: Switching JDBC datasources depending on user

混江龙づ霸主 提交于 2019-11-28 09:09:27
问题 Can anyone provide instructions on how to do this? I have several different JDBC DataSources set up and would like to be able to configure users to run the same report using different datasources. E.g. when user A logs in and runs report A, datasource 1 is used; when user B logs in and runs report A, datasource 2 is used. I am using version 4.0. 回答1: I'm working with release 6.2 of JasperReports Server and this is perfectly possible, as users have attributes and you can reference these

xPages repeat control with scoped variable as data source

感情迁移 提交于 2019-11-28 09:03:41
问题 I need to build repeat control or (view or data table) that uses scoped variable as data source. And the scoped variable should be an array.. Or even just javaScript array.. scoped variable: viewScope.MY_TEST = new Array(); viewScope.MY_TEST.push("Test1"); viewScope.MY_TEST.push("Test2"); or array: var my_arr = new Array(); my_arr.push("Test1"); my_arr.push("Test2"); or even an object/two dimensional array: viewScope.MY_TEST = []; viewScope.MY_TEST .push([value1, value2]); so repeat control

Multiple data source and schema creation in Spring Boot

≯℡__Kan透↙ 提交于 2019-11-28 09:00:57
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 idea how to resolve any of these issues? Note I don't want to completely throw away the auto-config if

Weblogic datasource disappears from JNDI tree

人盡茶涼 提交于 2019-11-28 08:19:37
We are using weblogic version 12C. Steps to reproduce the issue: - Create the datasource. Deploy the application to weblogic. Application works fine. Update the deployed ear with the new one. Application is not able to connect the datasource. Datasource not available in the JNDI tree. We need to create either a new datasource everytime or save the datasource setting again. Can someone please check and let me know if you know some solution for this? I had the same problem. Adding destroyMethod="" fixed it for me. Apparently if there is no destroyMethod, Spring tries to determine what the