datasource

How do you configure a JNDI datasource in Grails 3.x?

╄→гoц情女王★ 提交于 2019-12-04 15:10:27
Grails 3 (3.0.9) app is failing to start on a TC server where another 2 Grails 2 apps using each its JNDI datasource are running fine. It seems that replicating my Grails 2 JNDI settings in Grails 3 is not working (I left everything else default and specified driverClassName, dbCreate and jndiName for my prod datasource settings). The application has no problem connecting to the MySQL database straight through JDBC. Only JNDI makes it crash with the below exception (fragment)... ERROR grails.boot.GrailsApp - Application startup failed org.springframework.beans.factory.BeanCreationException:

Unable to access datasource remotely through JBoss

吃可爱长大的小学妹 提交于 2019-12-04 14:32:22
Context I have a JBoss where I have sucessfully deployed a datasource mydatasource-ds.xml . It's JNDI name is java:mydatasourceDS . JBoss claims that the datasource is succesfully deployed. The JMX console agress too. Problem I want to use this datasource from a client java app launched on a separate JVM. But I get an exception saying the java:mydatasourceDS cannot be found. java.lang.ClassCastException: javax.naming.Reference cannot be cast to javax.sql.DataSource Details Here is the persistence.xml file : <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java

MyBatis-guice 3.3 + Multiple datasources + properties + scriptrunner

独自空忆成欢 提交于 2019-12-04 14:23:18
I'm using MyBatis-guice 3.3 to connect to a first database using a java Properties object and a ScriptRunner to run few scripts: Environment environment = injector.getInstance(SqlSessionFactory.class).getConfiguration().getEnvironment(); DataSource source = environment.getDataSource(); ScriptRunner runner = new ScriptRunner(source.getConnection()); runner.setLogWriter(null); runner.setStopOnError(true); runner.runScript(Resources.getResourceAsReader(properties.getProperty("script.dbA.create.schema"))); Now I would like to add a second datasource (dbB) using the same approach. Following the

How to create Dynamic connections (datasource) in spring using JDBC

天涯浪子 提交于 2019-12-04 14:14:56
问题 I have a a spring application where i need to get server details for a oracle table and create dynamic connections as and when require based on some server id, How can I make this work? 回答1: Take a look at Spring's AbstractRoutingDataSource ( javadoc-api ). Which allows you to maintain a "router" dataSource bean that would be able to route to a required real dataSource at runtime based on a single property provided ( in your case it would be a server id ). Here is more about

How to make UI Image Picker Controller read a custom source type in iPhone

♀尐吖头ヾ 提交于 2019-12-04 13:24:06
问题 I have to create a photo gallery app in iPhone. It should function same as the Photos app which is shipped with iPhone. But it should show the images which I package with the app. UIImagePickerController reads only the following source types. UIImagePickerControllerSourceTypePhotoLibrary, UIImagePickerControllerSourceTypeCamera, UIImagePickerControllerSourceTypeSavedPhotosAlbum I was thinking of adding the images bundle to the resources group in Xcode and make UIImagePickerController to read

Jetty Bind DataSource in JNDI Context

别等时光非礼了梦想. 提交于 2019-12-04 13:20:21
I would like to bind DataSource object to (eclipse) jetty's JNDI context programatically. I need for testing purpose. Here's a piece of code I have now: server = new Server(SERVER_PORT); webAppContext = new WebAppContext(); webAppContext.setResourceBase("."); webAppContext.setContextPath("/" + SERVER_CONTEXT); webAppContext.addEventListener(prepareServletContextListener()); webAppContext.addFilter(GuiceFilter.class, "/*", null); webAppContext.addServlet(DefaultServlet.class, "/"); Resource r = new Resource(webAppContext,"jdbc/testDS",createDataSource()); server.setHandler(webAppContext);

A data source instance has not been supplied for the data source 'Request'

妖精的绣舞 提交于 2019-12-04 12:45:34
I'm getting an error on my reportviewer which I am not sure how to correct this.... The error that I am gettings is : " A data source instance has not been supplied for the data source 'Request'." I have tried searching for this, but can't find anything that I can see that is wrong, can somebody please point me in the right direction? This is how my reportvierer looks like: <rsweb:ReportViewer ID="rptViewer" runat="server" Height="654px" Width="924px" Font-Names="Verdana" Font-Size="8pt" InteractiveDeviceInfos="(Collection)" WaitMessageFont-Names="Verdana" WaitMessageFont-Size="14pt">

What is difference between MysqlDataSource and MysqlConnectionPoolDataSource?

微笑、不失礼 提交于 2019-12-04 12:17:00
I am configuring a mysql connection in an application server (glassfish specifically, but I am curious about other application servers as well) and it appears that there are 2 extremely similar options for the resource type & driver. Namely, MysqlDataSource and MysqlConnectionPoolDataSource . I am curious about what the difference between the two is. It appears that glassfish is maintaining a connection pool either way, so it's difficult to tell what the difference is. Thanks for any insight that you can provide. MysqlDataSource is a Java Native Database Interface that returns a connection to

How to connect dataSource and delegate with code - iOS Swift

故事扮演 提交于 2019-12-04 11:55:52
问题 I'm trying to have a better understanding on how the dataSource and delegate outlets get connected to the UITableView under the hood when you do the connection through the UI in Xcode by dragging and dropping to the viewController icon. I found this thread but I think I'm missing something because I cannot make it work. Here is the code I currently have that works fine by connecting the outlets through XCode (by drag and dropping). import UIKit class ViewController: UIViewController,

Is it possible to use a datasource deployment descriptor with a driver module in Wildfly?

人盡茶涼 提交于 2019-12-04 09:51:12
I can´t configure my datasource by using a "*-ds.xml" deployment descriptor with the database driver installed as module. The datasource *-ds.xml file is only valid if I deploy the database driver directly as jar. I think that If you choose to install the driver as a module you will have to configure the datasource in the standalone.xml directly. I would like the solution driver module + deployment descriptor. eis For your module to be visible to your application, you need to import the module to your application. You need jboss-deployment-structure.xml in your WEB-INF for your application,