I downloaded JDBC 2.1 and added jdbcLdap.jar as well as ldap.jar in my class path ( http://sourceforge.net/projects/myvd/files/jdbc%20ldap%20bridge/jdbc%20ldap%20bridge%202.1/jdbc-ldap-2.1.zip/download ). I would like to use it in my java application to connect to an LDAP, though I have not found any examples or explanations on how to use it (only how to connect to an sql server).
Could someone here possibly give a hint ?
The reference for the JDBC-LDAP bridge is located at the the MyVD site. I think you've missed looking at it; it is fairly comprehensive on how to create connections and issue commands against a LDAP server.
Related
I have developed a REST web-service in Java interacting with a MySQL database.I want to deploy the web-service and the create a database at a server so that I can invoke it from an application.I tried Microsoft Azure but was unable to get it done.Where can I find relevant information for this?
I had similar problems with a MySQL database using the third party option in the Azure Marketplace from ClearDb. What I ended up doing was switching my database from a MySQL instance to an Azure Database Instance (Subset of SQL Server's features.) This worked perfectly for me! I was able to query from my database feed data to my api, and access the API through my Azure Web App.
I understand this may not be an option for you, however, Digital Ocean is a great cloud hosting option (with scaling similar to Azure, although not as good in my honest opinion.) You can set up a Linux Environment with a MySQL Server and JVM and serve your whole API through there. Best of Luck!
#coderden, According to your description, I think you have been deployed your Java Application on an Azure WebApp. Then when you created a MySQL database on Azure for connection from the Java webapp, please make sure the webapp & mysql instance created in a same resource group and note the connection string of MySQL on Azure.
As reference, please see the article to try again although it's for PHP, the steps are the same for Java.
I have used file realm and JDBC realm before to host the username and password combinations. I have not yet used MongoDB to perform the same function. I have read the Tomcat docs and searched around but have not seen any tutorials.
Is there a realm someone knows of or am I missing something?
You can create your own realm and manually connect to Mongo.
This article here describes the process and provides sample code:
http://www.tomitribe.com/blog/2013/10/creating-a-mongodb-security-realm-for-tomcat/
Does anybody have specifics on how to connect an Android application to MongoDB running on Azure roles?
--
Hi, I have MongoDB replica set running on multiple Azure roles in the Cloud Service. I have used the mongo-azure library on GitHub to create the role instances and have them running in Azure.
Most articles online seem to only talk about connecting to Azure-MongoDB locally (via localhost). But, since my application won't be running locally to Azure, I feel that I have to use REST to somehow connect to Azure cloud servers, which may or may not propagate data to the MongoDB replica set.
Does anybody have more specifics on how to connect an Android application to MongoDB running on Azure roles?
(Or, for those that don't have experience with Android/Java: how to connect from non-localhost using non-.NET?)
ps - In other MongoDB questions, people have already answered Android is not natively support by MongoDB, and using non-native methods is fine by me. There are apps out there that already do this, mainly Foursquare. Unfortunately, they use AWS instead of Azure (the requirement for me).
pps - if anybody has any more resources for the linked mongo-library about how it works in more detailed terms, then that would be very helpful too.
UPDATE:
I found the most up-to-date version of mongo-java-driver.jar (currently 2.11.3) and am testing that.
Thanks to another question I've found the particular issue with Android not supported by the java driver, but that issue appears to be resolved.
Possible Solution:
In the Visual Studio project, I created an Input Endpoint for the role. So far that seems to do the trick, using MongoClient mongo = new MongoClient("<my_ip_address>", 27017);
Your 'possible solution' is the right one in my view - you need to open a (load balanced) TCP port in the firewall surrounding your roles and InputEndpoint is the way to do that.
You cannot use an input endpoint if you are doing writes when using a replica set of size > 1 if you are the github solution above. You do not want the Azure load balancer to route a write (insert or update) to a secondary of MongoDB in which case your write will fail.
If you use Azure virtual machines then you can create a port mapping per virtual machine instance and overcome this.
I'm currently working on a project where we have a Java web app bought from a 3rd party vendor that's connecting to SQL Server using Microsoft's JDBC driver. However, I've been given the requirement of having to encrypt the connection string using a proprietary encryption protocol.
So my question is how feasible would it be to extend the JDBC drivers distributed from Microsoft to incorporate this encryption. At this point I'm mainly thinking of creating a JDBC wrapper that will underneath use the Microsoft JDBC driver.
I'm open to other suggestions from more experienced people who might have done something similar in the past, or even if they could share pitfalls with this approach.
Use jtds. It's all java, works great for sql server, and supports encryption. It's a drop in replacement minus setting up encryption. You just need to know where they've configured their JDBC URL (hopefully in a configuration file under WEB-INF or some place like that), put in your jtds URL in there, and drop the Jar in the WEB-INF/lib directory. You may have to extract the WAR file and repackage it with jtds. It just depends on how this 3rd party vendor has deliver their app to you. And yes I've shipped production packaged enterprise software using it for years.
http://jtds.sourceforge.net/
So say they have a simple properties file like this:
db.url=jdbc:mssql:....
db.username=bibby
db.password=blahblahblah
Change it to:
db.url=jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]
db.username=bibby
db.password=blahblahblah
Of course you'll have to fill in all of the <> and [] parts as needed. Then copy jtds.jar and any dependencies it needs into WEB-INF/lib and restart the server. It should work.
if the original driver does not have your desired function -> you could fetch the official release (or fork it) and patch/add your needs
https://github.com/Microsoft/mssql-jdbc/releases
At this point I'm mainly thinking of creating a JDBC wrapper that will underneath use the Microsoft JDBC driver.
I guess that you need a proxy on server side to decrypt the connection inforamtion, and forward database connection to SQLServer's port.
I'm a java newbie, want to test out some hibernate goodies!
I have netbeans installed, and I included the Hibernate libraries.
I then created a new package named Model.
I will drop my Class and xml config files in there.
Do I need a special library to connect to sql server? (windows machine)
Yes, you'll need a JDBC library that talks to Microsoft SQL Server. jTDS used to be my first choice but the Microsoft JDBC driver has come a long way and I'd recommend using that. You can download it from this site.
You'll also need to follow these instructions to get the two talking to each other as SQL Server express doesn't listen to TCP by default and uses Windows Authentication Mode.
Have a look at these two URLs for examples of your hibernate.cfg: An explanatory Blog Entry and a JavaRanch Question.