Can I use Neo4j BI Connector with my Java app? - java

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.

Related

Java Eclipse Connect to MySQL via Tomcat

How to connect Tomcat9 to a MySQL database and access the database in eclipse using Vaadin14? I already pasted the mysql connector in the tomcat\lib directory. Is there anything else to do/change?
Afterwards i created a ui that contains a few text fields and a java class car with some attributes and the corresponding getters/setters. I bound the text fields to the attributes using a binder. In my database there is also a table car with the same attributes and some entries.
So how do i connect the database to my project in order to show one of the entries in my text fields and create a new entry?
Sorry if this is basic java/vaadin, but i'm quite new to databases.
So how do i connect the database to my project in order to show one of the entries in my text fields and create a new entry
You first need to connect to a database. It depends on your project, how you implement it. (via Spring, for example). A good discussion on this topic is here: Connect Java to a MySQL database
and some documentation here Connecting to MySQL Using the JDBC DriverManager Interface
Then you read data you need from a database. You can use ORM such as Hibernate or use a JDBC package as this. A discussion on pros/cons can be found here: What Java ORM do you prefer, and why?
Once you have your data available, you can bind an object to the binder (if you use one) or using setValue for the fields. There is an example for Vaadin 8 here : Building a web UI for MySQL databases (in plain Java), but it should be applicable with a Vaadin 14 as well. (Or what is your version?)
You could also check a bakery starter and how connection/reading is implemented there.
Some other useful links on topic:
What is JPA? Introduction to the Java Persistence API
Vaadin app with MySQL database

do I need to install sqlite software to connect in java?

To make connection to sqlite database and do some transaction, is it mandatory that a database software should be installed in the machine. I have seen that some libraries just handle connection and transactions without even database software. Or did I miss to notice that there were some database is already installed? How does the connection mechanism works?
A link to good article with detailed explanation would help me!
Thank you.
There are 2 options:
Use your DB locally:
For this you will need to install SQLLite on your machine, and in your project use JDBC jars for the connections from your java project to the DB. You may send queries to the DB as a string like "SELECT XXX FROM YYY WHERE a>b" or use Object Relational Mapping (ORM) tools like Hibernate.
If you have a remote DB installed on a VM on some cloud for example, then you don't need to install any DB on your local computer. But you will still need to use JDBC for connection.
You need Jdbc driver only or you can use ORM like hibernate.
Youtube has many tutorials about java and databases:
https://www.youtube.com/results?search_query=java+database+tutorial
If you are a begginer, start with jdbc with sql queries, later you should start using ORM's.
Probably you need to install mysql server or use this website https://www.elephantsql.com/ to get database instant.

Java API to connect to any kind of database(oracle, mysql, mssql, db2, h2 etc...)

I have a typical requirement from my client. There will be several types of databases that I need to connect to and collect some data from them and invoke a webservice with collected data. He will provide all datasource configurations to connect to respected database. based on datasource I need to figure out which database it is and need to prepare a connection management to connect to respected database.
Before hand, I would like to know, Is there any off the shelf API that could suite my requirement. I googled but no luck and hence landed here to post query. Suggestions are invited.
With Java Database Connectivity (JDBC) you can connect to any of the above databases, and there are open source drivers for those and many more.
Here's an example of using JDBC with MySQL. You use the same method to connect to any datasource with a given JDBC driver.

How feasible is it to extend Microsoft's JDBC driver?

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.

special driver to connect to sql server 2008 express

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.

Categories

Resources