I’m pretty new with Java (though I’m experienced with C#).
Anyway I’ve Googled a lot in the last few hours and I can’t understand something. I’m hoping you can help me with some guidance.
I’d like to use Eclipse with SQL Server and I have no idea how am I doing that.
I’ve seen some plugin called SQLExplorer but I just can’t figure what are the steps to integrate with that.
Regarding:
- What is the best way of doing that?
- Is there any guide or full tutorial?
- Maybe you have some source code example of a connection to SQL?
- Should I use that plugin? How?
- Why is it so difficult to find info about this issue? Isn’t eclipse familiar with SQL?
Thank you all.
Java and databases go together like bread and butter, but the language is just different enough that you might have issues breaking in. There are a number of different levels at which things can be integrated: the traditional query/result API is called JDBC, and all you need to work with any database from Java code is the appropriate JDBC driver. Here is the official one from Microsoft for SQL Server, and here is a tutorial about using the JDBC API.
Above that, there are object-relational mapping tools like Hibernate which let you persist Java objects directly onto your database. Hibernate automates a lot of the mapping and lets you work at a high level. Hibernate is an enormous subject; start here.
What SQLExplorer, and tools like it, let you do is browse around in a database, exploring the tables and the data in them. It’s not something you use with code, but rather interactively to examine the data you’re working with.
Here is a JDBC “Hello World,” assuming the default database on the local machine, a table named
some_table_namehas a character-valued column in the first position: