f



java.sql.SQLException: ORA-00905: missing keyword

while executing via Ant following statement

CREATE TABLE "ODDO_Securities"
	(
	"C_ID" NUMBER  NOT NULL,
	"SYSTEM_ID" NUMBER  NOT NULL,
	"SUBBRANCH_CODE" NUMBER  NOT NULL,
	"OPER_ID" NUMBER,
	"CC_CODE" NUMBER  NOT NULL,
	"PRICE" DOUBLE,
    "NOMINAL" NUMBER  NOT NULL,
    "ID_TYPE" NUMBER,
    "EMITENT_CODE" NUMBER(9),
    "PACK_CODE" NUMBER(9),
    "BRAND" VARCHAR2,
    "LIGATURA_MASS" NUMBER,
    "CHEMICAL_MASS" NUMBER,
    "HALLMARK" VARCHAR2,
    "SPEC_NUMBER" VARCHAR2,
    "MANUFACTURER_YEAR" VARCHAR2,
    "COUNT" NUMBER  NOT NULL,
    "NUMBER_FROM" NUMBER  NOT NULL,
    CONSTRAINT "PK_Security" PRIMARY KEY ("C_ID")
    )
/

I got java.sql.SQLException: ORA-00905: missing keyword .
What am I missing?

Ant task call is as following:
<sql driver="${db.jdbc.driver}"
         url="${db.jdbc.url}"
         userid="${db.project.user}"
         password="${db.project.password}"
         classpathref="oracle.jdbc.path"
         delimiter="/"
         src="${scriptHome}/createSchemaObjects.sql"
         onerror="abort"/>
0
iryndin
6/23/2009 2:48:42 PM
comp.lang.java.databases 3049 articles. 0 followers. samyaksulabh (16) is leader. Post Follow

10 Replies
1947 Views

Similar Articles

[PageSpeed] 54

On Tue, 23 Jun 2009 07:48:42 -0700, iryndin wrote:

> ORA-00905

That's an Oracle error, so RTFM for Oracle SQL syntax.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |
0
Martin
6/23/2009 2:54:43 PM
iryndin wrote:
> >> ORA-00905

Martin Gregorie wrote:
> That's an Oracle error, so RTFM for Oracle SQL syntax.

<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#i2095331>
<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/img_text/create_table.htm>

I'm not seeing the error.

-- 
Lew
0
Lew
6/24/2009 1:44:05 AM
"Lew" <noone@lewscanon.com> wrote in message
news:h1s0d5$dm0$1@news.albasani.net
> iryndin wrote:
>>>> ORA-00905
>
> Martin Gregorie wrote:
>> That's an Oracle error, so RTFM for Oracle SQL syntax.
>
> <http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_7002.htm#i2095331>
> <http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/img_text/create_table.htm>
>
> I'm not seeing the error.

It may not be an error, but in Oracle environment, it is usual to define the 
table space when creating tables. Other more or less important options too.


0
Donkey
6/24/2009 2:44:43 AM
iryndin wrote:
> while executing via Ant following statement
> 
> CREATE TABLE "ODDO_Securities"
> 	(
> 	"C_ID" NUMBER  NOT NULL,
> 	"SYSTEM_ID" NUMBER  NOT NULL,
> 	"SUBBRANCH_CODE" NUMBER  NOT NULL,
> 	"OPER_ID" NUMBER,
> 	"CC_CODE" NUMBER  NOT NULL,
> 	"PRICE" DOUBLE,
>     "NOMINAL" NUMBER  NOT NULL,
>     "ID_TYPE" NUMBER,
>     "EMITENT_CODE" NUMBER(9),
>     "PACK_CODE" NUMBER(9),
>     "BRAND" VARCHAR2,
>     "LIGATURA_MASS" NUMBER,
>     "CHEMICAL_MASS" NUMBER,
>     "HALLMARK" VARCHAR2,
>     "SPEC_NUMBER" VARCHAR2,
>     "MANUFACTURER_YEAR" VARCHAR2,
>     "COUNT" NUMBER  NOT NULL,
>     "NUMBER_FROM" NUMBER  NOT NULL,
>     CONSTRAINT "PK_Security" PRIMARY KEY ("C_ID")
>     )
> /
> 

Load this into sqlplus and try to execute it.
Then you'll know that DOUBLE is missing a keyword.
Using google or the manuals you can find out that the datatype synonym 
is called DOUBLE PRECISION if you want to use this synonym.
0
Frank
6/24/2009 6:38:39 AM
On Jun 23, 6:48=A0pm, iryndin <iryn...@gmail.com> wrote:
> while executing via Ant following statement
>
> CREATE TABLE "ODDO_Securities"
> =A0 =A0 =A0 =A0 (
> =A0 =A0 =A0 =A0 "C_ID" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "SYSTEM_ID" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "SUBBRANCH_CODE" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "OPER_ID" NUMBER,
> =A0 =A0 =A0 =A0 "CC_CODE" NUMBER =A0NOT NULL,
> =A0 =A0 =A0 =A0 "PRICE" DOUBLE,
> =A0 =A0 "NOMINAL" NUMBER =A0NOT NULL,
> =A0 =A0 "ID_TYPE" NUMBER,
> =A0 =A0 "EMITENT_CODE" NUMBER(9),
> =A0 =A0 "PACK_CODE" NUMBER(9),
> =A0 =A0 "BRAND" VARCHAR2,
> =A0 =A0 "LIGATURA_MASS" NUMBER,
> =A0 =A0 "CHEMICAL_MASS" NUMBER,
> =A0 =A0 "HALLMARK" VARCHAR2,
> =A0 =A0 "SPEC_NUMBER" VARCHAR2,
> =A0 =A0 "MANUFACTURER_YEAR" VARCHAR2,
> =A0 =A0 "COUNT" NUMBER =A0NOT NULL,
> =A0 =A0 "NUMBER_FROM" NUMBER =A0NOT NULL,
> =A0 =A0 CONSTRAINT "PK_Security" PRIMARY KEY ("C_ID")
> =A0 =A0 )
> /
>
> I got java.sql.SQLException: ORA-00905: missing keyword .
> What am I missing?
>
> Ant task call is as following:
> <sql driver=3D"${db.jdbc.driver}"
> =A0 =A0 =A0 =A0 =A0url=3D"${db.jdbc.url}"
> =A0 =A0 =A0 =A0 =A0userid=3D"${db.project.user}"
> =A0 =A0 =A0 =A0 =A0password=3D"${db.project.password}"
> =A0 =A0 =A0 =A0 =A0classpathref=3D"oracle.jdbc.path"
> =A0 =A0 =A0 =A0 =A0delimiter=3D"/"
> =A0 =A0 =A0 =A0 =A0src=3D"${scriptHome}/createSchemaObjects.sql"
> =A0 =A0 =A0 =A0 =A0onerror=3D"abort"/>

Guys, I digged out where the problem is =3D)
I have to write explicitly the size of VARCHAR2 fields. Example:

"BRAND" VARCHAR2
throws ORA-00905: missing keyword

"BRAND" VARCHAR2(255)
is OK!

Ivan Ryndin,
Java Dev Notes blog: http://jdevnotes.blogspot.com
0
iryndin
6/24/2009 11:43:32 AM
> iryndin wrote:
> > >> ORA-00905
> 
> Martin Gregorie wrote:
> > That's an Oracle error, so RTFM for Oracle SQL syntax.

Always a useful exercise.
 
Lew wrote:

> I'm not seeing the error.

I had to hunt it down. I've loved railroad-track diagrams since 
the days of Jensen & Wirth [1], so I can't resist elaborating.

As the OP determined, the compiler didn't like a VARCHAR2 of 
indeterminate size [2]. The corresponding diagram has no path without 
it. In contrast, precision and scale for NUMBER are optional, as the 
paths show.

Frank Langelage wrote:

> Load this into sqlplus and try to execute it. Then you'll know that 
> DOUBLE is missing a keyword. Using google or the manuals you can find 
> out that the datatype synonym is called DOUBLE PRECISION if you want 
> to use this synonym.

I'm confused. I see BINARY_DOUBLE, which has no qualification, but no 
DOUBLE PRECISION. Is DOUBLE perhaps a synonym for BINARY_DOUBLE?

[1]<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>
[2]<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements001.htm>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
John
6/24/2009 3:21:12 PM
John B. Matthews wrote:
>> iryndin wrote:
>>>>> ORA-00905
>> Martin Gregorie wrote:
>>> That's an Oracle error, so RTFM for Oracle SQL syntax.
> 
> Always a useful exercise.
>  
> Lew wrote:
> 
>> I'm not seeing the error.
> 
> I had to hunt it down. I've loved railroad-track diagrams since 
> the days of Jensen & Wirth [1], so I can't resist elaborating.
> 
> As the OP determined, the compiler didn't like a VARCHAR2 of 
> indeterminate size [2]. The corresponding diagram has no path without 
> it. In contrast, precision and scale for NUMBER are optional, as the 
> paths show.
> 
> Frank Langelage wrote:
> 
>> Load this into sqlplus and try to execute it. Then you'll know that 
>> DOUBLE is missing a keyword. Using google or the manuals you can find 
>> out that the datatype synonym is called DOUBLE PRECISION if you want 
>> to use this synonym.
> 
> I'm confused. I see BINARY_DOUBLE, which has no qualification, but no 
> DOUBLE PRECISION. Is DOUBLE perhaps a synonym for BINARY_DOUBLE?
> 
> [1]<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>
> [2]<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements001.htm>

Using [2] and scrolling down to ANSI_supported_datatypes you find DOUBLE 
PRECISION.
Using
http://www.google.de/search?hl=de&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=mhW&q=oracle+datatypes+double&btnG=Suche&meta=
you find a lot of other results, e.g. 
http://www.psoug.org/reference/datatypes.html.

Changing DOUBLE to DOUBLE PRECISION solved the ORA-00905 error, using an 
11g EE on Solaris.

The next error you get is ORA-00906 because of the missing length 
definition of varchar2 fields.

So the solution posted by the OP is not completely correct.
0
Frank
6/24/2009 5:42:23 PM
In article <7af6rvF1v0sfsU1@mid.individual.net>,
 Frank Langelage <frank@lafr.de> wrote:

> >> Load this into sqlplus and try to execute it. Then you'll know that 
> >> DOUBLE is missing a keyword. Using google or the manuals you can find 
> >> out that the datatype synonym is called DOUBLE PRECISION if you want 
> >> to use this synonym.
> > 
> > I'm confused. I see BINARY_DOUBLE, which has no qualification, but no 
> > DOUBLE PRECISION. Is DOUBLE perhaps a synonym for BINARY_DOUBLE?
> > 
> > [1]<http://www.inf.ethz.ch/personal/wirth/books/Pascal/>
> > [2]<http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/sql_elements001.htm>
> 
> Using [2] and scrolling down to ANSI_supported_datatypes you find 
> DOUBLE PRECISION.

D'oh, I see it now. Thanks. Sadly, it's not the first time I've 
forgotten that the browser's find command can't see pictures!

> http://www.psoug.org/reference/datatypes.html.

Very handy.

> Changing DOUBLE to DOUBLE PRECISION solved the ORA-00905 error, using 
> an 11g EE on Solaris.

Ah, the PRECISION part of DOUBLE PRECISION is required.

> The next error you get is ORA-00906 because of the missing length 
> definition of varchar2 fields.
> 
> So the solution posted by the OP is not completely correct.

ORA-00906: missing left parenthesis; your explanation makes sense.

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
John
6/24/2009 6:43:00 PM
John B. Matthews wrote:
> 
> I had to hunt it down. I've loved railroad-track diagrams since 
> the days of Jensen & Wirth [1], so I can't resist elaborating.
> 

Amen.

I wish I had a converter to railroad-track diagrams from nasty things 
like DTD XSD WSDL :-(

http://www.json.org/ ... <stimpy>Joy!</stimpy>

-- 
RGB
0
RedGrittyBrick
6/25/2009 9:58:49 AM
In article <4a434a59$0$18249$da0feed9@news.zen.co.uk>,
 RedGrittyBrick <RedGrittyBrick@spamweary.invalid> wrote:

> John B. Matthews wrote:
> > 
> > I had to hunt it down. I've loved railroad-track diagrams since 
> > the days of Jensen & Wirth [1], so I can't resist elaborating.
> 
> Amen.
> 
> I wish I had a converter to railroad-track diagrams from nasty things 
> like DTD XSD WSDL :-(
> 
> http://www.json.org/ ... <stimpy>Joy!</stimpy>

Cool. I found this on-line generator:

<http://www-cgi.uni-regensburg.de/~brf09510/syntax.html>

And this discussion of the diagrams on the JSON site:

<http://stackoverflow.com/questions/796824/tool-for-generating-railroad-diagram-used-on-json-org>

And this guide to reading the diagrams:

<http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/db2/rbafzmsthowtous.htm>

-- 
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>
0
John
6/25/2009 1:44:32 PM
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 la...

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...

SQL ERROR while executing the code java.sql.SQLException: ORA-01008: not all variables bound
Hi all i'm getting the above error plz tell me how to solve that error the code snippet is as bellow while(rst.next()){ con1=DriverManager.getConnection(url2,"rcxdev1","rcxdev1"); PreparedStatement pstmt=null; pstmt=con1.prepareStatement(sb.toString()); for(int i=0;i<mp.size();i++){ if((mp.get(rst.getMetaData().getColumnLabel(i+1)).equals("NUMBER"))) { pstmt.setInt(i+1,rst.getInt(i+1)); System.out.println("number "+i+" "+rst.getInt(i+1)); } if((mp.get(rst...

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 ...

Database and java.sql.SQLException Questions
Hello everyone!! I am back for some more much need advice and assistance! I am creating a database for the first time. I am changing some programs I recently wrote to work with this database that have to do with Salesmen. I am getting the below error when I compile CreateDatabase.java. In that I am creating the database SalesDatabase and then creating 5 tables (Users, SType, Salesman, Sales, Product). The first thing I do is create those tables and then insert informtion into the SType table and Product table. SType is the SalesType of a salesman, meaning Entry, Junior or Senior ...

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.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(Cla...

java.sql.SQLException:ORA-00904
Hi All, I am getting below error while executing my query in java program however when I run the same query on Toad/ sqlplus the query runs fine resulting the desired results. java.sql.SQLException: ORA-00904: : invalid identifier at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:208) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:542) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1333) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:617) at oracle.jdbc.driver.Oracle...

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...

java.sql.SQLException: Could not open database table
Hello NG, with Informix I get the error java.sql.SQLException: Could not open database table in my servlet after 253 or 254 selects/updates. Any idea how to solve this Problem. Its Informix SE and its not a Problem from the jdbc driver.... Chris You can find the text behind any error message by typing finderr <msgno> at the command prompt. The ones you're getting come out as: -253 Identifier length exceeds the maximum allowed by this version of the server. A name in the statement exceeds the maximum length. In 7.x, 8.x, and 9.1x versions of the databa...

Loading a large dataset from a database-- java.lang.OutOfMemoryError: Java heap space
Dear all, While trying to load a big table, I received the following error. Is there any way to circumvent this problem without doing additional programming? Thanks you help, Kirill Andreev ??? Java exception occurred: java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Unknown Source) at java.util.Arrays.copyOf(Unknown Source) at java.util.Vector.ensureCapacityHelper(Unknown Source) at java.util.Vector.addElement(Unknown Source) at com.mathworks.toolbox.database.fetchTheData.dataFetch(fetchTheData.java: 740) Error in ==> cursor....

java.sql.SQLException: ORA-00904: invalid identifier
Hi, I'm using Java 1.5 with WebLogic 9.2.2 connected to an Oracle 10 db. I'm getting the below error but what is odd is that I can run the offending SQL statement fine using PL/SQL Developer. I have verified that the connection information is the same. Any way to tell exactly what is the "Invalid identifier"? Thanks, - Dave java.sql.SQLException: ORA-00904: "NPS_LOG"."PKG_NPSLOG"."GET_LKUP": invalid identifier at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:211) at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224) at weblogic.jdbc.rmi.internal.PreparedStatementImpl_weblogic_jdbc_wrapper_PreparedStatement_oracle_jdbc_driver_T4CPrepar edStatement_922_WLStub.executeQuery(Unknown Source) at weblogic.jdbc.rmi.internal.PreparedStatementStub_weblogic_jdbc_rmi_internal_PreparedStatementImpl_weblogic_jdbc_wrapp er_PreparedStatement_oracle_jdbc_driver_T4CPreparedStatement_922_WLStub.executeQuery(Unknown Source) at weblogic.jdbc.rmi.SerialPreparedStatement_weblogic_jdbc_rmi_internal_PreparedStatementStub_weblogic_jdbc_rmi_internal _PreparedStatementImpl_weblogic_jdbc_wrapper_PreparedStatement_oracle_jdbc_driver_T4CPreparedStatement_922_WLStub.executeQuery(U nknown Source) at com.myco.nps_history.dao.NPSHistoryDAO.getKeyTypes(NPSHistoryDAO.java: 210) at com.myco.nps_history.beans.SearchBean.getKeyTypes(SearchBean....

java.sql.SQLException: ORA-01034: ORACLE not available
Hi! As you'll notice I'm new to oracel :) I set up 9i r2 on a linux machine but the attempt to connect to a database (java, jdbc) ends up with the following: java.sql.SQLException: ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux Error: 2: No such file or directory at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289) at oracle.jdbc.ttc7.O3log.receive1st(O3log.java:407) at oracle.jdbc.ttc7.TTC7Protocol.logon(TTC7Protocol.java:259) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:346) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:468) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:314) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:140) at com.onseven.dbvis.wrapper.DriverManagerImpl.getConnection(DriverManagerImpl.java:40) at com.onseven.dbvis.sql.Database.doConnect(Unknown Source) at com.onseven.dbvis.sql.Database.access$000(Unknown Source) at com.onseven.dbvis.sql.Database$ConnectionCommand.execute(Unknown Source) at se.pureit.util.ThreadCommand.runExecute(Unknown Source) at se.pureit.util.ThreadCommand.run(Unknown Source) at java.lang.Thread.run(Thread.java:534) ...

java.sql.SQLException: ORA-01006: bind variable does not exist
ps = conn.prepareStatement(" UPDATE USF_HEA_BENEFIT_AMOUNTS SET " + " BENEFIT_1_2_AMT = ?, " + " BENEFIT_3_5_AMT = ?, " + " BENEFIT_6_PLUS_AMT = ?, " + " CREATED_BY = '?' " + " WHERE " + " HEA_BENEFIT_CATEGORY_CDE = '?' AND " + ...

java.lang.Set with elements of type java.lang.Set
Roughly I do something along the lines of: Set set = new HashSet(); Set elem = new HashSet(); set.add(elem); // now we change the elem and add it again to the set elem.add(some object here); set.add(elem); I found out the hard way that 'set' may now contain 'elem' either once or twice, the reason being that 'elem.add()' changes the hashCode of elem such that it is not noticed that it is in 'set' already on the 2nd 'set.add()'. Question: What I would actually want is an IdentityHashSet() set = new IdentityHashSet() but this does not...

Intermittent java.sql.SQLException: ORA-00902: invalid datatype
Hi, We are getting java.sql.SQLException: ORA-00902: invalid datatype exception intermittently while saving the data in db using java, most of the times it is working for the same data elements, We are using Oracle SQL types to save the data in Oracle9i database! Please give some suggestions why we are getting this exception only in some times -? On Feb 12, 12:24=A0am, Suresh <eluri.sur...@gmail.com> wrote: > Hi, > > We are getting java.sql.SQLException: ORA-00902: invalid datatype > exception intermittently while saving the data in db using java, most > of the times i...

java.sql.SQLException: ORA-01036: illegal variable name/number
Hi, I have a simple java classes trying to call a function in a database. Below is the function signature. function search_pipe_out (p_matching_ids in varchar2 ,p_return_pipe in varchar2 ,p_errorcode in varchar2 )return number is // implementation start here.... My Java Program public class Test { public static void main(String[] args) { CallableStatement csmt = null; Connection con = null; csmt = null; try{ Class.forName("oracle.jdbc.driver.OracleDriver"); System.out.println("oracle.jdbc.driver.OracleDriver was loaded successfully"); con = DriverManager.getConnection("jdbc:oracle:oci8:@ORAWTCP","zzndn07","atlantis"); System.out.println(con.toString()); csmt =con.prepareCall( " { call ? := BU00153P.search_pipe_out ( ?, ?, ? ) }"); csmt.registerOutParameter(1, Types.NUMERIC); csmt.setString(2,"24598520,47162288,47162289"); csmt.setString(3, "BIP1PIPE$00400F450001"); csmt.setString(4,"0"); System.out.println(csmt.toString()); csmt.execute(); System.out.println("Done."); csmt.close(); con.close(); }catch(Exception e) {e.printStackTrace();} } } I get these error at the execute statement. java.sql.SQLException: ORA-01036: illegal variable name/number at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134) at oracle.jdb...

java.sql.SQLException: ORA-00020: maximum number of processes (100) exceeded
Hello Friends, I am getting the following error. java.sql.SQLException: ORA-00020: maximum number of processes (100) exceeded I am closing all my resultsets and all my connections in the try block. should i close ResultSets and Connections in the catch block aswell?. or the problem is due to the connection pool settings in weblogic or on the oracle side instead of in my application. Thanks in Advance s You need to close at least your Connection object in the finally clause, like this: Connection conn = null; try { //get connection... //do stuff... } catch (SQLException sqle) { e.printStackTrace(); } finally { try { conn.close(); } catch (Exception e) { //do nothing } } If your application hits the database a lot, you might want to have your DBA increase the maximum number of processes (I'm not a DBA, so I don't know how to do this, or what side-effects it might have). -Nathan sumithradevi@hotmail.com wrote in message news:<2eee46ec.0310291902.4ee0527@posting.google.com>... > Hello Friends, > > I am getting the following error. > java.sql.SQLException: ORA-00020: maximum number of processes (100) > exceeded > > I am closing all my resultsets and all my connections in the try > block. > should i close ResultSets and Connections in the catch block aswell?. > > or the problem is due to the connection pool settings in weblogic or > on the oracle...

to use import java.lang.* or import java.lang.Math or none at all?
Hi guys, i knew that by default all java.lang classes will be imported by the compiler during compilation. but, to make it easier for the computer, should i specify which class i really will be using? does this action will boost the performance during compilation and runtime or not a matter at all? the answer to this post will definitely affect my programming style in the future when i'm considering "to import or not to import"... hmm,,, thanks in advance. JPractitioner wrote: > i knew that by default all java.lang classes will be imported by the > compiler during compilation. but, to make it easier for the computer, > should i specify which class i really will be using? does this action > will boost the performance during compilation and runtime or not a > matter at all? Whether and how you import classes has exactly zero effect at runtime. Imports (with or without wildcards) are only a kind of abbreviation provided by the compiler to save us the effort of typing in fully-qualified type names every time. In theory explicit importing should make compilation faster -- by a very tiny amount. I've never heard anyone claim that they've even managed to measure a difference let alone found a case where it made a practical difference. So the question comes down to how to write your code for maximum clarity. One school of thought asserts that you should always import each class explicitly (rather than by a wildcard). There's a fai...

"ORA-00905: missing keyword" when tuning the sql statement using join
The following query yields the correct result, but the performance is extremely poor. When I run the explain plan in TOAD, it costs 167560 and it performs the full table scan on (SELECT MAX ...) statement. I try to tune the sql statement using join, but I got the error "ORA-00905: missing keyword" on clause "AND p.company_seq_no = c.company_seq_no". I have no idea what's going on, please advise what is the best approach to tune the original SQL. ORIGINAL SQL ============ SELECT p.finance_no, vda.finance_no, vrf_type FROM p_permit p, p_company c, p_vrf_details vda WHERE p.permit_seq_no = '1001' AND p.company_seq_no = c.company_seq_no AND c.ref_id = vda.ref_id AND p.finance_no = vda.finance_no AND vda.vrf_type IN ('M','P') AND vda.activity_date = (SELECT MAX(activity_date) FROM p_vrf_details vdb WHERE ref_id = vda.ref_id AND finance_no = vda.finance_no AND vrf_type = vda.vrf_type AND vrf_level = vda.vrf_level AND pstg_stmt_seq_no is not null ) UPDATED SQL =========== SELECT p.finance_no, vda.finance_no, vrf_type FROM p_permit p, p_company c, p_vrf_details vda JOIN p p_vrf_details vdb ON p.permit_seq_no = '1001' AND p.company_seq_no = c.company_seq_no AND c.ref_id = ...

java.lang vs java.util
Surprising to see something defined in java.lang <http://developer.android.com/reference/java/lang/Iterable.html> depend on something defined in java.util <http://developer.android.com/reference/java/util/Iterator.html>. Surely the hierarchy should go the other way? On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: > Surprising to see something defined in java.lang > <http://developer.android.com/reference/java/lang/Iterable.html> depend on > something defined in java.util > <http://developer.android.com/reference/java/util/Iterator.html>. > > Surely the hierarchy should go the other way? I think Iterable may make it into java.lang because of its significance in the foreach statement. Patricia On 04/02/2011 12:23 AM, Patricia Shanahan wrote: > On 4/1/2011 9:11 PM, Lawrence D'Oliveiro wrote: >> Surprising to see something defined in java.lang >> <http://developer.android.com/reference/java/lang/Iterable.html> depend on >> something defined in java.util >> <http://developer.android.com/reference/java/util/Iterator.html>. >> >> Surely the hierarchy should go the other way? Not if it wants to be consistent with http://download.oracle.com/javase/6/docs/api/ don't'cha think? And the so-called "hierarchy" of java.util and java.lang is that they are equal. The language reserves for itself the entire panoply of java.* and javax.* packages. > I think It...

modifying java.lang.String.java
Hi, I'm trying to modify java.lang.String.java and add the modified String.class to rt.jar [THIS IS FOR MYSELF ONLY AND WILL NOT BE DEPLOYED]. I cannot add "private final boolean tainted[] = new boolean[5];" to String.java. If I do, it still compiles and I can add it to rt.jar and compile a test program against it. However, the JVM crashes with a strange message: java.lang.IllegalArgumentException: name can't be empty at java.security.BasicPermission.init(Unknown Source) at java.security.BasicPermission.<init>(Unknown Source) at java....

List Java keywords from within Java?
How can I list Java keywords from within Java? You know.. if, else, void, class.. I had a look over System and Class docs but could see nothing helpful. I want to highlight the keywords in source, the lazy way. -- Andrew Thompson * http://www.PhySci.org/ PhySci software suite * http://www.1point1C.org/ 1.1C - Superluminal! * http://www.AThompson.info/andrew/ personal site "Andrew Thompson" wrote: > How can I list Java keywords from within Java? > > You know.. if, else, void, class.. You have to enumarate them yourself. AFAIK there is nothing in the public API wh...

Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object
I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these commands: # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version Error occurred during initialization of VM java/lang/NoClassDefFoundError: java/lang/Object # ls /usr/jdk/instances/ jdk1.5.0 jdk1.6.0 # uname -a SunOS sun1 5.10 Generic sun4u sparc SUNW,Sun-Blade-2500 Please help to fix the error. Thanks. TsanChung wrote: > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > commands: > # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - > # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx > > # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version > Error occurred during initialization of VM > java/lang/NoClassDefFoundError: java/lang/Object It's missing or can't find rt.jar, right? How does the Solaris version find it's runtime files? Can you show us where rt.jar is? On Aug 20, 6:24=A0pm, Mark Space <marksp...@sbc.global.net> wrote: > TsanChung wrote: > > I downloaded jdk-6u7-solaris-sparcv9.tar.Z and installed it by these > > commands: > > # zcat jdk-6u7-solaris-sparc.tar.Z | tar -xf - > > # pkgadd -d . SUNWj6rtx SUNWj6dvx SUNWj6dmx > > > # /usr/jdk/instances/jdk1.6.0/bin/sparcv9/java -version > > Error occurred during initialization of VM > > java/lang/NoClassDefFoundError: java/lang/Object > > It'...