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.
Related
Neo4j have recently added a BI connector tool (neo4j.com/bi-connector) which can return relational data from your graph database to your business intelligence tool such as Tableau. The question is can i send SQL queries to this connector assuming i have added the jar file to my java application class path? If yes, which APIs should i use to send this SQL query to the driver?
I'm using Neo4j4.0.
For neo4j.com/bi-connector, if you look at the document PDF that you get when you download it, on page 10 where they show how to establish a connection you'll see that you get a connection object. After you have that, you have a standard JDBC connection which is a Java interface that tells libraries how to talk to a SQL database. There are a lot of different tools that use this interface, it's kind of user preference. A common one is JOOQ.
I am setting up a presto server. I have modified the open source jdbc of presto and developed my presto jdbc jar which is used for authentication. I am using db visualizer tool wherein I can copy the jdbc jar file in the path and use it to authenticate my presto db server. I wanted to switch to a web UI and I see many people recommending apache-superset. I see that the apache-superset is written in python. Is there a way to plugin my jdbc driver for presto in apache-superset so I can connect to my database and start querying the data.
I see that under Sources Tab we an add our database but this won't help me in connecting to my environment.
Apache Superset use PyHive package to communicate with Presto and also supports authentication. So, If this connector is not enough for your case you can use these approaches:
Modify Pyhive package for your usage.
Use JayDeBeApi to use your own JDBC Driver and create your own database connector on superset.
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 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.
I'm looking for a java database server that has support for database to be shared and opened from a PHP web application and a java application simultaneuosly.
I found Apache Derby and H2 Database but they don't have a clear support for PHP application.
Please suggest.
It must be a Java Database Server, since we are planning that we may have to distribute the applications to customers, so we need something portable and redistributable.
Most popular databases have drivers for PHP and for Java.
They also support concurrent connections. Choosing something like SQL Server, Oracle, MySql, Postgres will work just fine.
MySQL might work fine for you. I've used it myself in projects where I both need to access it from java and PHP.