This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all, I'm a new in java database. does JDBC always related to ODBC, ie. we need to setup ODBC in control panel first? what is if I want to use less connection DSN? Microsoft also release JDBC beta 2 recently (if I'm not wrong). is it the best if we use SQL Server? in term of portability, is it better we stick with "basic" Java JDBC-ODBC?? What about webLogic driver? thanks all anthony
JDBC is a common way to define Database operations in Java, allowing you to abstract the database operations from a specific vendor. There for in theory you write the same code for any database you plug into your program, and you should be able to swap databases without too much trouble. (in theory) ODBC is the MS way of providing a standard interface to databases. There is a specific driver called the 'Type-1 driver' or JDBC-ODBC bridge that provides a mapping between JDBC calls and the associated ODBC calls. Consider this: you install a database, ithas ODBC drivers, and this is what you use to register as an ODBC source in MS-land. Now you can use the ODBC data to talk to your database. It is also possible at this stage to get the JDBC-ODBC bridge to talk to ODBC, then you can talk JDBC to the bridge. Or you can find the specific JDBC driver for the database and make your calls to that... At this point we should introduce the different types of JDBC drivers (more info here) They range from: Type 1 is the JDBC-ODC bridge as already discussed. Type 4 is a driver written in Java that talks the specific language to the database. Now to your actual question, what MS released was the beta version of a Type4 Driver for SQL server. If you go to the JDBC Driver listings page you will se that there are 34 JDBC drivers available fot SQL server. The one from BEA is just one of them. You should note that the BEA driver conforms to JDBC 1 as opposed to JDBC 2, which includes a bunch of additional functionality. I hope this covers most of your issues. Dave
"anthony", The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp. We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please edit your profile and select a new name which meets the requirements. Thanks. Dave