SQL and Java Database

I have a task to create an application that will associate Java with a SQL database, when I served Google, I found that I need to load the Java JDBC driver (jar files), which will allow me to connect to the SQL Server database from Java, but I found many different versions.

So can someone tell me about the differences between the two?

I am using the latest version of Java (jdk 1.6.0), also using SQL Server 2008

Also, I heard about JDBI and was protected more than JDBC, so is it true or not, and if it is true, how can I use JDBI instead of regular JDBC?

Please help as soon as you can.

Thanks at Advance

0
source share
6 answers

You looked here you need one that is compatible with your version of jdk.

Year JDBC Version JSR Specification JDK Implementation 2006 JDBC 4.0 JSR 221 Java SE 6 2001 JDBC 3.0 JSR 54 JDK 1.4 1999 JDBC 2.1 JDK 1.2? 1997 JDBC 1.2 JDK 1.1? 
0
source

Each SQL database has its own driver with possible versions. Some SQL databases have more than one driver.

Can you tell us the exact version and name of your SQL database? Without this, I donโ€™t think we can offer a specific driver / version.

There are also different JDBC standards, however you must use the version that matches your driver. If you are using the latest JDK 6, it should support them all.

+1
source

You need to find the right JDBC driver to connect to Microsoft SQL Server using JDBC. The following are the preferred drivers for SQL Server:

jTDS is the open source JDBC 3.0 driver for Microsoft SQL Server (6.5, 7, 2000, and 2005). Put the jar file in your path to the application class. The java.sql package along with the above driver helps connect to the database.

Microsoft SQL Server 2000 Driver for JDBC is a Type 4 JDBC driver. You need to put the jar files in the CLASSPATH variable.

+1
source

When you talk about versions, are you talking about different providers of database drivers, or about JDBC driver types or driver version numbers?

As far as driver providers are concerned, it depends on which database you are connecting to. Typically, all database vendors release JDBC drivers for their databases (MS for MS-SQL, Oracle for Oracle database, etc.).

Regarding the type of JDBC driver, a โ€œcleanโ€ Java driver (type 4) is the defacto standard when looking for a JDBC driver for obvious reasons.

As for the actual version number of this driver for this implementation, just go to the latest stable version.

0
source

Each database manufacturer has implemented a driver to connect to its database. JDBC is an API that defines how a client can access this database. Each driver has its own implementation, so it will depend on you:

  • Get the latest driver for the database system you want to connect. The latest version of JDBC is JDBC 4, so find a driver compatible with JDBC 4 (if you are using JDK 6)
  • Use Google to find good resources on how to use the JDBC API to connect to your database system.

Hope this helps.

0
source

The difference you are talking about can be caused by two things: one of them is the Jars version, and the second is the database type, each database has a dedicated driver to support data exchange.

There are various relational databases on the market, for example, MS SQL Server, Oracle Database, MySQL.

As for the version, select the latest stable version of drivers for your database.

0
source

All Articles