Not providing db credentials in quartz config - configuration

I am using quartz in a web application and using QuartzInitializerServlet.
Now to run it on multiple systems, I have added a database to make it run it in clustered mode. The dataSource properties are provided in quartz.properties file but this exposes the database credentials in cleartext.
Is there some way to use QuartzInitializerServlet but provide the dataSource credentials through code (where I can retrieve the credentials stored elsewhere) ?

Here is the documentation : http://www.quartz-scheduler.org/documentation/quartz-2.3.0/configuration/ConfigDataSources.html#configure-datasources
Use the jndiUrl property to specify the jndi name of your datasource:
org.quartz.dataSource.NAME.jndiURL = java:comp/env/jdbc/www_datasource
HIH

Related

Is there a way for geotools PostGIS DataStore to use a JEE DataSource?

The geotools DataStoreFinder expects a Map of properties, including mainly the connectivity information, depending on the store.
For the PostGIS plugin this includes the dbtype (which must be "postgis") and the database host, port, schema, database, username and password.
http://docs.geotools.org/stable/userguide/library/jdbc/postgis.html
In my application, there are other tables which are being accessed using Spring Data (JPA Repositories / Hibernate and Hibernate Spatial).
Is there a way to make the PostGIS connection information to use the standard JEE DataSource that is injected by Spring? This way I won't have to duplicate the configuration to the same database and do custom property handling.

Access MySQL server from Grails

I like to setup a dedicated MySQL server in a LAN accessible from other computers of this network. How can I setup the database server and the clients?
How can a Grails application can access the MySQL from the same LAN?
If your MySQL server is going to run on Windows then you can configure it with the installation program. For example, I downloaded the install file mysql-installer-community-5.6.20.0.msi (versions change quickly) and it offers the option of installing just the server:
Just follow the screen prompts and take all the default values (strongly recommended). The main values to remember are:
The default network port number 3306.
The server's ip address.
The username(s) and password(s) that you created that have access to
MySQL.
Then I suggest you download HeidiSQL and configure a connection to your new MySQL server, that way you can manage your database server remotely:
Hope that helps.
You are asking 2 differents questions.
To set up mysql connection in your grails app, did you at least try to read the doc ?
http://grails.org/doc/latest/guide/single.html#dataSource
It's just a jdbc connection string :
https://www.google.fr/?gws_rd=ssl#q=jdbc+mysql+connection+string+example
It's more than just the JDBC connect string. You won't get far without a driver, so uncomment the sample entry in BuildConfig.groovy in the dependencies section and update the version to the most recent:
dependencies {
...
runtime 'mysql:mysql-connector-java:5.1.34'
}
Set the driverClassName in DataSource.groovy, along with the correct JDBC url for your database. Replace <server> with the server name or IP address, and <dbname> with the correct database name. You will likely also want to add parameters at the end of the url in the querystring. And if the port is non-standard (3306 is the default) then add that in also. To ensure that you use INNODB tables (older versions of MySQL default to MyISAM), specify the MySQL5InnoDBDialect (or a subclass):
dataSource {
...
driverClassName = 'com.mysql.jdbc.Driver'
dialect = org.hibernate.dialect.MySQL5InnoDBDialect
url = 'jdbc:mysql://<server>/<dbname>'
}
Run grails compile to download the driver jar and setup the classpath.

SSIS Project Deployment Model: assign sensitive parameter to a project connection string

We are using SSIS 2012 Project model and have project connection (manager) for all our packages, we create environment for dev, test and prod and created a variable "Connectionstring" inside each of them, the connection string is SQL Server authentication, so we have set the variable as sensitive to keep password hidden and then we configured the project connection manager to use the environment variable for the connection string. When we run the package we get the below error
"Unable to map an environment variable with the sensitive property set to True, to a parameter with the sensitive property set to False. Ensure that the property settings match"
I was unable to find a location where we can set the sensitive property for project connection manager, FYI when I uncheck the sensitive in the environment variable ,the packages run fine.
Am I missing something? I don't see a place where we can set the expression for project connection manger either, if that was the case at least I could have used the project parameters and set it to sensitive and configure the environment variable to load into the parameter and in turn use parameter in the expression for project connection string.
Use one environment variable for the connection string without the password, and create another environment variable for just the password and set it to Sensitive. Then map the password variable directly to the Password property in Connection Managers while configuring the project in SSMS (this doesn't require creating additional parameters).
The Password property is sensitive by design while the Connection String is not.
i was trying to parameterize the project connection but couldn't find it,but was able to figure it our later,posting answer so that some one else can find it like me, please "right click on project connection inside a package not directly under project connection managers and then click parameterize
So are you mapping the connection string to a project parameter? ( you would want to do this to take advantage on the configuration manger to change these parameters on the fly when you change the drop down for environment- Then set the project parameter variable to be sensitive and you should be good to go

CloverETL mySQL Database SSL secure connection & Parameters

I am trying to make the connection to a remote mysql database in CloverETL Designer (Community Version)
Documentation with examples on this subject seem fragmented so I have tried to piece the bits together but I'm not use if they are correct. I would be grateful for any suggestions or further clarification on this subject.
Here is what I have so far:
The SSL Certificate
As an alternative VPN connection the server guys passed me the raw CA certificate, which I saved as a .crt file in the conn folder of the CloverETL workspace.
CloverETL Connections
I created a new DB connection and tested it was working without SSL
In the graph window I created a simple graph
Switching to Source View I added the parameter attribute to the connection code like this:
<Connection database="MYSQL" dbURL="jdbc:mysql://hostname/database_name" id="JDBC0" jdbcSpecific="MYSQL" name="CPM" parameters="ssl=${WORKSPACE}/conn/mysql_cpm_cert.crt" password="password" type="JDBC" user="username"/>
Then I tested the connection to the database by creating new metadata from a DB table
The problem is that I don't know if the connect is now secure or not.
Here's the list of resources that I used to piece together the information:
components:bulkloaders:mysql_data_writer [CloverETL wiki]
MySQL :: MySQL 5.0 Reference Manual :: 6.3.6.3 SSL Command Options
Thanks
CPM
Your setup almost certainly does not use ssl. Both links you posted are not usable - first describes bulk loader and second connection via command line client. But what you need is to configure JDBC. So I would use http://dev.mysql.com/doc/refman/5.0/en/connector-j-reference-configuration-properties.html section "Security."
I would set:
useSSL=true
requireSSL=true
You will do that by adding items in table (Custom JDBC properties) on second tab (Advanced) of Connection Wizard. In source it should appear like "jdbc.useSSL=true jdbc.requireSSL=true" not "parameters=".
Then connection should fail, because in your default java key store is missing your certificate. It can be imported via http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/keytool.html section "Importing Certificates"
I hope this helps.

MySql database deployment in cloudfoundry

I've developed an application using JSP, Spring Security, MySql. I deployed it on Cloudfoundry. But just war file and I binded mysql service. But I also have to configure MySQL database that consists of two tables, new user and it all in my own database. While i tested my application on localhost i prepared the database running manual scripts in MySQL command window.
Question: How can I make the same configurations in CloudFoundry? can I the same way run all commands and scripts manually or export the database somehow? if yes, how to do this. And what to write here now instead of localhost?
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc:mysql://localhost:3306/security_filter" />
thank you
Caldecott (vmc tunnel) is the correct way to access your cloudoundry database (for me it works and i am using ruby 1.8): http://docs.cloudfoundry.com/tools/vmc/caldecott.html
If that does not work for you you will have to do something manually (much harder):
Create a sample jsp/servlet application that connects to a mysql database (retrieving connection string, username and password as input from user). Then it will just run the sql statement against the database ( sql statement will be also input from user)
Bundle this application in your war
Now you have to retrieve database connection string/username and password. You can retrieve them from the enviromental variable VCAP_SERVICES. Just log log it in a startup listener (eg ServletContextListener)
Deploy your war and get logs from server (vmc logs ApplicationName). Get connection string, username and password
Logon to your application and use your database application to access the database using the db info you collected in the previous step
Just note that this is very dangerous approach. Just be sure to secure this database application or after the initial import remove it from your war and redeploy the application
As a final note you can check if such a database console application already exists so that you dont have to create your own (for example grails has a nice application for this http://grails.org/plugin/dbconsole. Maybe something exists for jsp/servlets)
Hope it helps if you have no luck with the ruby problem
You would need to create a mysqldump of your database.
Once you have the mysqldump file, you then use caldecott and perform vmc tunnel to your MySQL service. After you have establish a connection with your MySQL service on Cloud Foundry, you then need to use the mysql command to manually import the mysqldump file into your service.
For how to use vmc tunnel, visit the documentation site at: http://docs.cloudfoundry.com/tools/vmc/caldecott.html