f



java.sql or javax.sql?

Why are there both a java.sql and a javax.sql API?


0
JS
5/16/2005 8:49:25 PM
comp.lang.java.help 13340 articles. 0 followers. Post Follow

1 Replies
541 Views

Similar Articles

[PageSpeed] 45

"JS" <dsa.@asdf.com> writes:

> Why are there both a java.sql and a javax.sql API?

In short, java.sql is part of J2SE, and javax.sql is part of J2EE.
0
5/17/2005 6:27:40 AM
Reply:

Similar Artilces:

java.sql.SQLException: java.sql.Time
I get the following error message... java.sql.SQLException: Value '00:00:00 can not be represented as java.sql.Time >From the following SQL call... SELECT COUNT(pageurl) AS PageCount, pageurl, MAX(datetime) AS LastAccess, SUM(VisitLength) as TotalVisitLength, VisitLength, RecordNum, SUM(CASE WHEN VisitLength IS NULL THEN 1 ELSE 0 END) AS NullVisits FROM clubvisits WHERE groupid = #clubid# GROUP BY pageurl ORDER BY #OrderKey# I am using ColdFusion 7 on MySQL 4.1.12a. I'm not a Java programmer - I don't know any Java, but ColdFusion acts essentially as a script layer to J2EE, so for some reason it's throwing a Java error. I'm especially stuck, because I need to resolve this without programming any Java, and the Adobe forums for ColdFusion and MySQL groups are no help. The error refers to the "VisitLength" field which is a "time" data type in the database. In the MySQL documentation, it says that 00:00:00 is allowable for time (http://dev.mysql.com/doc/refman/4.1/ en/ time.html). So my question is, why is this error coming up if it's an allowable value? And is there anything I can do? >So my question is, why is this error coming up if it's an allowable >value? And is there anything I can do? one way is to store the values as raw ints or longs as far as SQL is concerned. -- Roedy Green Canadian Mind Products The Java Glossary http://mindprod.com <mehatespam1085@yahoo.com> wrote... ...

java.sql.SQLException: java.sql.Time
I get the following error message... java.sql.SQLException: Value '00:00:00 can not be represented as java.sql.Time >From the following SQL call... SELECT COUNT(pageurl) AS PageCount, pageurl, MAX(datetime) AS LastAccess, SUM(VisitLength) as TotalVisitLength, VisitLength, RecordNum, SUM(CASE WHEN VisitLength IS NULL THEN 1 ELSE 0 END) AS NullVisits FROM clubvisits WHERE groupid = #clubid# GROUP BY pageurl ORDER BY #OrderKey# I am using ColdFusion 7 (not my choice - don't laugh) on MySQL 4.1.12a. The error refers to the "VisitLength" field which is a "time" da...

How to perform cleanup for javax.sql.DataSource, like we do for java.sql.Connection
Hello all, I am using a weblogic server. I am trying to get a connection from a DataSource using following code. I am not sure if I should do anything with the DataSource as part of cleanup. There is no close method for DataSource, nor any other method whose name suggests that it should be used for cleanup. I am closing my connections, but what should I do with DataSource. Code listing below. Thanks. :) ==================== private DataSource src = null; private final String DATA_SRC = "NonXADataSource"; private Connection getConnection() { Connection c = null; ...

Help with java and sql
Can someone please help me? I am getting the error message: [MySQL][ODBC 3.51 Driver][mysqld-5.0.24a-community-nt]No database selected When I open up (control panel) (administrative tools) (ODBC) and click on plantco, then configure and then test, it says success connection was made, but when I open command prompt and put in C: cd\ cd j2sdk1.4.2_12\testprog javac EXO.java java EXO data2 I get the above error message This is what I have put in notepad: import java.sql.*; import javax.swing.*; import java.awt.*; import java.io.*; public class EXO { public static void main (String [ ] args ) { String recordInput=" "; String sqlCommand= " "; try { String url="jdbc:odbc:plantco"; String user="root"; // The user name String password=""; // The password Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection conn=DriverManager.getConnection(url, user, password); Statement sttmnt=conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); String filename=""; if (args.length > 0) { filename = args [0];//Filename } else { System.out.println("Must supply a file name!"); System.exit(0); } BufferedReader inputFile=new BufferedReader (new FileReader(filename + ".txt")); sttmnt.executeUpda...

HELP !!! java.sql.SQLException: General error HELP!!!!!
Hello When I wanna remove a record from my Database or update a record in my database. I get a java.sql.SQLException: General error, but he does remove the record. what does it mean java.sql.SQLException: General error and how can i fix it?! Greets Vampyrotica There might be another thread running a query on the table which has locked the table. Vampyrotica wrote: > Hello > > When I wanna remove a record from my Database or update a record in my > database. I get a java.sql.SQLException: General error, but he does > remove the record. what does it mean java.sql.SQLException: General > error and how can i fix it?! > > Greets Vampyrotica I had the same problem and I found the mistake: "statement.close()" was before I tried to run "statement.ExecuteUpdate()". Check it. "Vampyrotica" <leandra_s@hotmail.com> skrev i melding news:92b9eb78.0406141413.546ed930@posting.google.com... > Hello > > When I wanna remove a record from my Database or update a record in my > database. I get a java.sql.SQLException: General error, but he does > remove the record. what does it mean java.sql.SQLException: General > error and how can i fix it?! > > Greets Vampyrotica ...

Convert java.util.Date to java.sql.Date
I convert java.util.Date to java.sql.Date this way:java.util.Date utilDate = new java.util.Date();java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime());And then send sqlDate to prepareStatement.ps.setDate(1, sqlDate).But I got the date such as dd-mm-yyyy. And I need also take hours,minutes pm(am).How can I get the Date "dd-mm-yyyy hh:mm a"? Bumsys@gmail.com wrote: > I convert java.util.Date to java.sql.Date this way: > > java.util.Date utilDate = new java.util.Date(); > java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); > > And then send sqlD...

(Again) java.util.Date vs java.sql.Date
Hi there, (Again) Im trying to understand the EXACT difference between java.util.Date vs java.sql.Date. Googling, I can see that this is a very "popular" subject, but I still cannot figure out it exactly. Many writers claim that java.sql.Date only stores the DATE part (yyyy- mm-dd) but not the TIME part (hh:MM:ss) of a Date/Time value, but that I can easily disprove: java.util.Date ud = new java.util.Date(); java.sql.Date sd = new java.sql.Date(ud.getTime()); System.out.println(DateFormatUtils.format(ud, "yyyy-mm-dd hh:MM:ss.SSS")); System.out.println(DateFormatU...

How to match a Java SQL Exception to the SQL error message
Hi, is it possible to relate a Java SQL exception (for example: SQL Editor - bad syntax in a user's sql statement) to the corresponding db2 error message in a java application? Does it depend on the JDBC driver type? Thanks Florian florian.boldt@itgain.de wrote: > Hi, > > is it possible to relate a Java SQL exception (for example: SQL Editor > - bad syntax in a user's sql statement) to the corresponding db2 error > message in a java application? > Does it depend on the JDBC driver type? When you receive a SQL exception, you can extract the original error message as was generated by DB2. If you don't get the DB2 error message, then it may be your application doing some fancy stuff without even touching the DBMS. I have my doubts that you will be able to relate the error messages then. -- Knut Stolze DB2 Information Integration Development IBM Germany danke Knut, we do receive the db2 retun code but we don't know how or from where to extract the message text. Any hints? Thanks Florian Knut Stolze schrieb: > florian.boldt@itgain.de wrote: > > > Hi, > > > > is it possible to relate a Java SQL exception (for example: SQL Editor > > - bad syntax in a user's sql statement) to the corresponding db2 error > > message in a java application? > > Does it depend on the JDBC driver type? > > When you receive a SQL exception, you can extr...

Java/J2EE PA(Oracle,SQL,PL/SQL)
Title: Java/J2EE PA(Oracle,SQL,PL/ SQL)Ajax,JSP,Struts,Ibatis,Spring,Unix Skills: Java/J2EE Programmer,Oracle,SQL,PL/ SQL,Ajax,JSP,Struts,Ibatis,Spring Framework,Unix Shell Scripts,Oracle Apps Server 9iAS/10G a Plus,CVS,JUnit,ANT,Log4j,OSCache,Intellij Trinity Consultancy Services is seeking applications from qualified and experienced software engineers with above skills for various requirements with their Clients. Job description: Java Programmer Analyst (Strong Java/J2EE/JSP/Struts) Experience with Ajax/iBatis/Spring Framework, Excellent Oracle SQL/PL SQL Skills, ability to write complex qu...

Cast from java.util.DATE to java.sql.DATE
DB ORACLE Calendar stCal = Calendar.getInstance(); stmt.setDate(COLUMN_DATA, stCal.getTime()); doesn't work because setDate method Sorry for the first post.... DB ORACLE Calendar stCal = Calendar.getInstance(); stmt.setDate(COLUMN_DATA, stCal.getTime()); doesn't work because setDate method (int, java.sql.Date) in the type PreparedStatement is not applicable for the arguments (int, java.util.Date) If I try with: stmt.setDate(COLUMN_DATA, (java.sql.Date)stCal.getTime()); I obtain a class cast exception Any solution? How can I insert a java.util.date obtained from a calendar object in a Oracle DB (java.sql.Date)? thanks in advance Dom On 01.02.2005 12:36 Dom wrote: > > Any solution? How can I insert a java.util.date obtained from a calendar > object in a Oracle DB (java.sql.Date)? > Calendar stCal = Calendar.getInstance(); java.util.Date utlDate = stCal.getTime(); java.sql.Date sqlDate = new java.sql.Date(utlDate.getTime()); stmt.setDate(COLUMN_DATA, sqlDate); Thomas "Thomas Kellerer" <NNGNVRDSJEBN@spammotel.com> schrieb im Newsbeitrag news:3698dfF4v06i6U1@individual.net... > > > On 01.02.2005 12:36 Dom wrote: > > > > Any solution? How can I insert a java.util.date obtained from a calendar > > object in a Oracle DB (java.sql.Date)? > > > > Calendar stCal = Calendar.getInstance(); > java.util.Date utlDate = stCal.getTime()...

Converting java.util.Date to java.sql.Date
Hello Friends In my program i am using the following codes: Date today = new Date(); log.debug("today is"+today); SimpleDateFormat fmt = new SimpleDateFormat("yyyy-mm-dd"); String todayStr = fmt.format(today); log.debug("todayStr value"+todayStr); java.sql.Date dt = java.sql.Date.valueOf(new String(todayStr)); log.debug("current Dt is:"+dt); The output iam getting is like this: today is Sat Sep 09 19:20:13 IST 2006(from java.util.Date) todayStr value 2006-20-09(from string value) current Dt is: 2007-08-09(from java.sql.Date) So h...

Returning Variant data from Java to PL/SQL & SQL?
Folks, I'm trying to define a oracle Java Stored Proc interface to an existing timeseries database. Series are accessed by name and are returned as vectors of type pairs, specifically (Date, number) (Date, date), (date, string), (number, number), (number, date) or (number,string). I could simply create all the types and their table types create or replace type xxx_datnum_t as object ( item DATE, value NUMBER ); / ... create or replace type xxx_datnum_tab as table of xxx_datnum_t; / ... then access these types from Java via the StructDescriptor and ArrayDescriptor apis while defining multiple typesafe call_specs to access the data from PLSQL and SQL. The problem with this solution is it requires my PL/SQL code to know in advance what the return type will be from a request. Is there any way to build and return types in Java and then return them to Oracle? (apart from returning everything as a string!!) I suspect there isn't but you never know your luck!! Any help on this would be greatly appreciated (including being told it's not possible!. Thanks Nick ...

java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException
Hi, I am new to DB2. I am getting this error while loading the DB2Driver. I don't have any idea about where i might have gone wrong. please help me. Below is the stack trace. Stack Trace: java.lang.ExceptionInInitializerError: java.lang.ArrayIndexOutOfBoundsException at COM.ibm.db2.jdbc.app.DB2Driver.SQLAllocEnv(Native Method) at COM.ibm.db2.jdbc.app.DB2Driver.<init>(DB2Driver.java:245) at COM.ibm.db2.jdbc.app.DB2Driver.<clinit>(DB2Driver.java:130) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:120) Thanks in advance, Ganesh Majji ganesh.m@gmail.com wrote: > I am new to DB2. I am getting this error while loading the DB2Driver. I > don't have any idea about where i might have gone wrong. please help > me. Unfortunately my crystal bowl stays dark because you didn't mentioned your operating system and which DB2 version you're using. For Windows, *nix and OS/2 please ensure that your application is using the db2java.zip from SQLLIB\java. Check if there are multiple db2jdbc.dll on your system, remove any extra db2jdbc.dll files on the system. Ensure that you can connect to DB2 with the DB2 workstation tools from your machine. sorry for not mentioning the system details. Operation System is SunOS (Solaris) and DB2 SDK 8.2.2 Thank you very much for the kind response, Ganesh Bernd Hohmann wrote: > ganesh.m@gmail...

Help
Hi, all, I am looking for suggestions for an open-source Java library that can represent arbitrary SQL queries. I work for a national data center where we are developing a web-based application that provides access to hundreds of different databases and thousands of tables of scientific data. The principal databases we use are MySQL, Postgres, Oracle, Sybase, Informix, and DB2 but there are others in use as well. The application allows a developer to store the "where" clause of an SQL query with a arbitrary numbers of parameter values left unspecified. The web application th...

Java in Java
Is it possible to download a Java app (applet etc?) and run it inside a desktop Java app? -- Dirk http://www.transcendence.me.uk/ - Transcendence UK http://www.theconsensus.org/ - A UK political party http://www.onetribe.me.uk/wordpress/?cat=5 - Our podcasts on weird stuff Dirk Bruere at NeoPax wrote: > Is it possible to download a Java app (applet etc?) and run it inside a > desktop Java app? > Quite likely, but you won't necessarily get the same security model, unless you were careful about it. -- Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/&g...

Java Java
Have my first Open Source Linux Java Project. Working on a second right now. Coming out with a distro called OPEN*WINDOWS. It will be at www.black-and-company.com tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a distro called OPEN*WINDOWS. > > It will be at www.black-and-company.com > Wasn't that the whole point of Lindows? Oh, right, we didn't care for that either. tab wrote: > Have my first Open Source Linux Java Project. > Working on a second right now. > > Coming out with a ...

Java/SQL
I have this SQL statement and I need to change the WHERE clause in the SQL statement to its java equivatlent. Something like this: @command1, @username2 ,@receiver is input parameter WHERE ( [Test]=2 AND (command LIKE @command1 AND Username2 LIKE @Username2) AND (lac is null or lac=@receiver) ) Java equivatlent: if( (Test == 2) & (command LIKE @command1 & username2 LIKE @username2) & (lac is null | lac== receiver) ........... But I have trouble with translating LIKE, is n...

java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460)
Hi All I am having the torque3.1.jar and postgresql-7.4. I have compiled the new jdbc driver called as postgresql.jar and have placed it in the lib directory from where the ant scripts catch the jars. Whenever i try to access through torque gestList = BaseGestlistPeer.doSelect(new Criteria()); this error arises java.lang.StringIndexOutOfBoundsException: String index out of range: 23 at java.lang.String.charAt(String.java:460) at org.postgresql.jdbc2.ResultSet.toTimestamp(ResultSet.java:1653) at org.postgresql.jdbc2.ResultSet.getTimestamp(ResultSet.java...

FREE JAVA GUIDE- free Java, j2ee, sql and plsql tutorials
This site lists General Java tutorials and tutorials on specific Java programming topics. This site lists fully documented java tutorials, java servlets, JSP pages, and related Java technologies like sql tutorials and plsql tutorials All this at http://www.freejavaguide.com -- Message posted via JavaKB.com http://www.javakb.com/Uwe/Forums.aspx/java-setup/200604/1 ...

US-CT: Stamford -Senior Java Developer with Core Java and SQL Experience...
************************************************************** JobCircle.com is the largest regional job board in the Mid-Atlantic region, with tens of thousands of job offerings in PA, NJ, DE, MD, NY, and Washington D.C. To learn more, visit http://www.jobcircle.com?source=ng ************************************************************** Job Title: Senior Java Developer with Core Java and SQL Experience... Job Location: CT: Stamford Pay Rate: Open Job Length: over 1 year (contract) Start Date: 2009-02-05 Company Name: Genesis10 Contact: Susan Clifton Phone: email Fax: email Description: Description: Genesis10 is seeking a Senior Java Developer for our major client located in Stamford, CT on a 12 month basis. This is for new development of a tool as part of Notification and Response. This tool will take responses from clients (internal and external) in various formats and manage that and allow the users to see them in various reports/views as well as granted different levels of entitlements for various users. Experience: Required Experience/Skills: - Strong core Java and SQL. - Must be able to do the complete life cycle of design and development and work independently as well as participate in team collaboration in the overall system design. Preferred Experience/Skills: - Some experience working with Oracle, Spring and Hibernate preferred. - Experience working with Tomcat Apache or Tibco Ems is a plus. - E...

US-CT: Stamford -Senior Java Developer with Core Java and SQL Experience...
************************************************************** JobCircle.com is the largest regional job board in the Mid-Atlantic region, with tens of thousands of job offerings in PA, NJ, DE, MD, NY, and Washington D.C. To learn more, visit http://www.jobcircle.com?source=ng ************************************************************** Job Title: Senior Java Developer with Core Java and SQL Experience... Job Location: CT: Stamford Pay Rate: Open Job Length: over 1 year (contract) Start Date: 2009-02-20 Company Name: Genesis10 Contact: Sus...

java.sql.Date value truncated using JDBC in MS-SQL Server
Hi, I'm trying to write a java.sql.Date to a database and the minutes/ seconds etc. are not being written. I've seen and tested many examples found via searches and still have come up with nothing. Here's what I have: java.sql.Date formation - recommended constructor forms: java.sql.Date entryDttm = new java.sql.Date(System.currentTimeMillis()); OR java.sql.Date entryDttm = new java.sql.Date(new java.util.Date().getTime()); // prepared statement insert pstmt.setDate(1, entryDttm); // what is written to database 2007-02-07 12:00:00.000 // what needs to be w...

US-TX-Austin: Java Developer, Oracle, PL/SQL, Java, 2mo. (45392237474)
US-TX-Austin: Java Developer, Oracle, PL/SQL, Java, 2mo. (45392237474) ====================================================================== Position: Java Developer Reference: ALM00034 Location: Austin TX Duration: 2mo Skills: Development experience with previous Team Lead or Management experience Java with heavy JDBC, JMS, XML, XSLT and J2EE WebSphere Experience with Oracle, PL/SQL and SQL Server Excellent communication skills Ability to interact with management Scop...

US-TX-Austin: Java Developer, Oracle, PL/SQL, Java, 2mo. (45391932742)
US-TX-Austin: Java Developer, Oracle, PL/SQL, Java, 2mo. (45391932742) ====================================================================== Position: Java Developer Reference: ALM00034 Location: Austin TX Duration: 2mo Skills: Development experience with previous Team Lead or Management experience Java with heavy JDBC, JMS, XML, XSLT and J2EE WebSphere Experience with Oracle, PL/SQL and SQL Server Excellent communication skills Ability to interact with management Scop...

Web resources about - java.sql or javax.sql? - comp.lang.java.help






[Java] package grafica; import javax.swing.JFrame; public class InterfaceGrafica - Pastebin.com
package grafica;import javax.swing.JFrame;public class InterfaceGrafica { public static void main(String args[]) { JFrame w = new JFrame(); w.setTitle("JFrame ...

David Cameron's big fat silence on gypsies - Mail Online Server Issue javax.el.ELException: Error reading ...
KELVIN MACKENZIE: You hear all kinds of bilge from David Cameron but he hardly ever touches on those areas &#8212; such as traveller-related ...

Server Issue javax.el.ELException: Error reading 'groupName' on type uk.co.and.dailymail.common.doma ...
Home News U.S. Sport TV&Showbiz Femail Health Science Money Video Coffee Break Travel Fashion Finder Latest headlines You mag Event Books Promos ...

Open Directory - Computers: Programming: Languages: Java: Implementations
... code. Most APIs are supported, except the AWT and Swing. [Open Source, GPL] GNU Classpath Extensions - A free replacement for the "javax.*" ...

Java (programming language) - Wikipedia, the free encyclopedia
Java Standard Edition 7 Update 4 (1.7.4) (April 26, 2012 ; 22 days ago ( 2012-04-26 ) ) .java, .class, .jar Java is a programming language originally ...

Resources last updated: 3/9/2016 8:50:15 PM