Results 1 to 5 of 5
  1. #1
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    112
    Rep Power
    0

    Default Conflict in Java official documentation

    Quoting the Link 1:

    "The Java Database Connectivity (JDBC) API is the industry standard for database-independent connectivity between the Java programming language and a wide range of databases – SQL databases and other tabular data sources, such as spreadsheets or flat files. "

    Link 1:Java SE Technologies - Database

    Quoting the Link 2:

    "Note that if you are using another DBMS, you might have to alter the code of the tutorial samples."

    Link 2: Getting Started (The Java™ Tutorials > JDBC(TM) Database Access > JDBC Basics)

    Why the conflict?

  2. #2
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: Conflict in Java official documentation

    Hi,

    my personal view is:
    The api is the same for all Databases. So there are no different calls or something like that (which is something normal. It is the same in .Net or QT.)

    But the sql commands can be different from database to database. So there might be a requirement to change your code. But that will be changes to the sql commands in my eyes. (Or maybe even some workarounds because the database is not supporting something that is required.)

    Konrad

  3. #3
    jmohandos304 is offline Senior Member
    Join Date
    Apr 2014
    Posts
    112
    Rep Power
    0

    Default Re: Conflict in Java official documentation

    But the sql commands can be different from database to database. So there might be a requirement to change your code.

    Partially agree with you but need a more concrete answer.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,120
    Rep Power
    20

    Default Re: Conflict in Java official documentation

    That is the concrete answer.
    SQL is not standard between all databases.
    Also, depending on the driver version for the db you are using, not all aspects of JDBC may be implemented.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: Conflict in Java official documentation

    Maybe you want a simple example? Imagine you want to get the top 10 rows of a query.
    So a common way is
    SELECT TOP 10 column1, column2 FROM someTable ORDER BY columnx
    This will work fine on MS SQL Server. But mysql will complain about it. So you want to write
    SELECT column1, column2 FROM someTable ORDER BY columnx LIMIT 10
    instead (Which does not work on MS SQL)

    So this is a quite simple example. And these queries are really simple. It can quickly get complex when you have to build CTEs and stuff like that (Which mysql does not support at all!).

    Ohh - just one clarification is required. I wrote that it is similar in .Net and QT. That was not correct.
    In JDBC you have one set of classes. And you always use the same classes. In .Net it is not that way. You have a set of base classes (e.g. DbConnection) and then you have to use the correct class for your Database. So if you want to access an SQL Server, you use SqlConnection. If you want to connect to SqlCe, then it is SqlCeConnection. Or OleDbConnection for all drivers that use OLE (e.g. MS Access, Excel, ...) So there is a real requirement to change the code in .Net even if it is just a change of the Connection class. So I was simply wrong when I said that.

    With kind regards,

    Konrad

Similar Threads

  1. Installing JAva SE Documentation
    By Suhi200 in forum New To Java
    Replies: 2
    Last Post: 05-29-2013, 10:26 AM
  2. Java Official Documentation Error?
    By afunuks in forum New To Java
    Replies: 6
    Last Post: 02-05-2011, 06:24 AM
  3. Attaching the Java documentation
    By Eranga in forum NetBeans
    Replies: 11
    Last Post: 08-09-2010, 05:17 AM
  4. Proofread my Java documentation?
    By javanewbie in forum New To Java
    Replies: 1
    Last Post: 06-24-2008, 09:39 AM
  5. Java Documentation
    By ravian in forum New To Java
    Replies: 4
    Last Post: 12-04-2007, 10:45 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •