|
-
Nov 11th, 2006, 06:01 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] difference between java.sql and javax.sql
hello
i was wondering what the difference between the java.sql and javax.sql libraries were?
-
Nov 11th, 2006, 06:36 PM
#2
Re: difference between java.sql and javax.sql
They contain different stuff. The javax.sql stuff contains a few extensions to the core JDBC in java.sql, like the DataSource interface.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 11th, 2006, 06:59 PM
#3
Thread Starter
Frenzied Member
Re: difference between java.sql and javax.sql
thanks for the reply cornedbee
is java.sql a subset of javax.sql?
-
Nov 11th, 2006, 07:13 PM
#4
Re: difference between java.sql and javax.sql
No. javax.sql is an extension to java.sql. It contains additional classes and interfaces. But they still are based on the functionality provided by java.sql.
For example, javax.sql.DataSource is a method of obtaining java.sql.Connection objects.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 12th, 2006, 07:08 AM
#5
Thread Starter
Frenzied Member
Re: difference between java.sql and javax.sql
thanks for yet another insight cornedbee
but why could they not release a new version of java.sql, why add a new library?
i guess when you import javax.sql, one does not need to import java.sql?
-
Nov 12th, 2006, 08:21 AM
#6
Re: difference between java.sql and javax.sql
 Originally Posted by vb_student
i guess when you import javax.sql, one does not need to import java.sql?
And why would you assume that? They're just Java packages. They have no idea that they're related.
(You shouldn't import complete packages either, just single classes selectively.)
but why could they not release a new version of java.sql, why add a new library?
The javax.sql stuff was originally part of the J2EE specification, which never modifies java.* packages, only javax.* packages. Thus they couldn't alter java.sql.
When in J2SE 1.4 they included the new stuff, they didn't want to change the package name, obviously: it would have broken both source and binary compatibility.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 12th, 2006, 09:08 AM
#7
Thread Starter
Frenzied Member
Re: difference between java.sql and javax.sql
i thought
imported the whole package, how does one import just a class?
so java.* package are the foundation packages, and javax.* packages are the packages built on java.*
does java add on javax.* or does it modify javax.*
by changing/modifying the javax.* packages isn't source and binary compatibility broken?
-
Nov 12th, 2006, 09:37 AM
#8
Re: difference between java.sql and javax.sql
 Originally Posted by vb_student
imported the whole package, how does one import just a class?
import java.sql.Connection;
so java.* package are the foundation packages, and javax.* packages are the packages built on java.*
Sort of. Not all javax.* classes are built on the java.* classes; instead they provide completely independent services. javax contains Swing, for example.
Does java add on javax.* or does it modify javax.*
Eh?
Look, forget "modifying" and "adding". They're all just classes. They may make use of classes in other namespaces, but nothing modifies anything else.
by changing/modifying the javax.* packages isn't source and binary compatibility broken?
Sure, but these packages weren't changed. Adding new classes to a package doesn't break anything (except source that uses wildcard imports like "import java.util.*" - that can break if a new symbol conflicts with another that's in scope), nor does adding new methods to classes break anything. Only modifying existing things breaks code: changing the package a class is in, for example.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Nov 17th, 2006, 04:43 PM
#9
Thread Starter
Frenzied Member
Re: difference between java.sql and javax.sql
thanks for the insight cornedbee
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|