SQL 3 « oracle « Java Database Q&A





1. Regular expression for replacing symbols    stackoverflow.com

I'm writing an application that can execute different SQL statements(user specify these statements as one string value). I'm using ";" as delimeter between statements(at once user can execute many DML statements). ...

2. How to update multiple rows of a table based on one value?    stackoverflow.com

I have two columns in my table "res_allocation", one "ResName" and other "PID", "ResName" will have multiple values for a single "PID". Is there a single query for updating values of "ResName" ...

3. Need help in finding an Oracle Exception.. Java+Oracle+Prepared Statement    stackoverflow.com

Forgive me if this question is very vague Some time back i faced this issue. I used java and wrote a prepared statement INSERT into a table that had a few CLOBS. I ...

4. oracle.sql.TIMESTAMP Vs java.sql.Timestamp    bytes.com

plsHelpMe Hi All, I have ercently migrated my project on the WAS6 which is utilizing the below configuration: WebSphere Platform 6.1 [BASE 6.1.0.2 cf20633.22] running with process name LNGDAYV-0000493Node01Cell\LNGDAYV-0000493Node01\server1 and process ...

5. Couldn't store job: Driver's Blob representation is of an unsupported type: oracle.sql.BLOB    forums.terracotta.org

org.quartz.JobPersistenceException: Couldn't store job: Driver's Blob representation is of an unsupported type: oracle.sql.BLOB [See nested exception: java.sql.SQLException: Drier's Blob representation is of an unsupported type: oracle.sql.BLOB] I get this problem when i use Quartz with Oracle 11g driver version is 11.1.0.7 . I have dropped the jar in the common/lib directory of tomcat. Stacktrace: org.quartz.JobPersistenceException: Couldn't store job: Driver's Blob representation ...

6. Driver's Blob representation is of an unsupported type: oracle.sql.BLOB    forums.terracotta.org

App Server Environment: Tomcat 5.x Quartz version : 1.8.5 Oracle Driver: ojdbc14-10.2.0.4.0 Oracle DB: 10g Relevant Quartz Properties block within appcontext 6000000 org.quartz.impl.jdbcjobstore.oracle.OracleDelegate true 20000 DexClusteredScheduler AUTO true On Application launch the appcontext has a problem reported as Caused by: org.quartz.JobPersistenceException: Couldn't store job: Driver's Blob representation is of ...

7. package oracle.sql    coderanch.com

8. java.sql.Date and Oracle.    coderanch.com





10. sql statement, implicitly open cursor and oracle session...    coderanch.com

Hi, In my application, I have a JDBC connection which I create and re-use over and over. The connection is used to execute sql statement, whose resultset is stored in bean object. So the sequence of executing an SQL is as outlined below: . . . String sql = "select customerName, address from customer"; Connection connection = getPreviouslyCreatedconnection(); // returns valid ...

11. javax.sql.RowSet, Oracle JDBC    coderanch.com

12. Mapping Oracle DATE to java.sql.Date ?    coderanch.com

13. upgraded to oracle 8i. Getting java.sql.SQLException.    coderanch.com

We upgraded to Oracle 8i and we are unable to connect to database. Before we had oracle 8.0.5. We used classes111.zip for oracle driver. Now we are using classes12.zip. We are unable to connect to database. Do you guys have any idea what could be wrong. Let me know if i am not clear. I will try to explain the situation ...

14. JDBC THIN gives Oracle invalid character error, though SQL works fine in TOAD    coderanch.com

try { Statement stmt = conns.createStatement (); String insert = "insert into SEQREQ_AUDIT (SEQREQ_AUDIT_ID, LABHEAD, PROGRAMME, LABJOURNAL, ORGANISM, TISSUE,"; insert=insert.concat("CELL_LINE, RDS1, RDS2, NTUSER, COUNTRY, DATE_CREATED, SSP, SEQ_SUBMISSION,FL_ID) "); insert=insert.concat(" values ('"+SEQREQ_AUDIT_ID+"','"+LABHEAD+"','"+PROGRAMME+"','"+LABJOURNAL+"',"); insert=insert.concat("'"+ORGANISM+"','"+TISSUE+"','"+CELL_LINE+"','"+RDS1+"','"+RDS2+"','"+NTUSER+"',"); insert=insert.concat("'"+COUNTRY+"',SYSDATE,'"+SSP+"','"+SEQ_SUBMISSION+"','"+FL_ID+"');"); System.err.println("SQL insert: "+insert); stmt.executeUpdate(insert); } catch (SQLException e){ e.getMessage(); System.err.println("Error-Insert record:" +e + e.getMessage()); message = ("ERROR - INSERT RECORD"); } [B]Logs[/B] SQL insert: insert into SEQREQ_AUDIT (SEQREQ_AUDIT_ID, ...

16. Sybase to Oracle conversion. (SQL)    coderanch.com

Hi Are you sure you can run your query sucessfully in sybase? Because I don't see a condition in your query which uniquely identify which row of Tb_A to be updated. If you are using two tables you can do the following in oracle: update Tab1 set (a.Val1, a.Val2) = (select b.Val1, b.Val2 from Tab2 b where a.id = b.id); If ...





17. oracle.sql.* and oracle.jdbc.driver.*    coderanch.com

Hi Everyone I have the following two statements in my code, import oracle.jdbc.driver.*; import oracle.sql.*; When i try to compile the code it gives me the following error messages, picloader.java:13: package oracle.jdbc.driver does no import oracle.jdbc.driver.*; ^ picloader.java:14: package oracle.sql does not exist import oracle.sql.*; Can somebody tell me how to solve this problem.. this is very very urgent... Thank You ...

19. Any ORacle PL\SQL function - starts with alphapbet    coderanch.com

Hi, I am just wondering whether there's any oracle PL\SQL function, which tells whether the particular value starts with an alphabet. I want to select values from a table which doesn't start with an alphabet. Please provide an idea. I think, we can do this using substr , but i guess it'll be expensive. Thanks Neelima

20. java.sql.Date, Oracle - DateFormating?    coderanch.com

21. oracle SQL Execution Time    coderanch.com

23. Oracle JDBC driver does not support Datatypes defined in java.sql?    coderanch.com

Hi Bob, Thanks for the response...but let me tell you there is no ambiguity in my question or my understanding of the problem.... it is simple.. the setClob(paramindex nInt, java.sql.Clob aClob) simply throws a java.lang.ClassCastException, and there is no stack trace other than three lines of Exception info...the Exception is thrown in the setClob() method on the Ojdbc Driver. And as ...

24. update oracle table with SQL loader??    coderanch.com

Hi All, I'm not sure if this is the right place to ask this kind of question, so pls forgive me if I go to the wrong place. Can anyone tell me what should I do if I need to update a oracle table base on an external data file? I used to do it manually with SQL loader but want ...

25. Array Input to a Oracle SQL    coderanch.com

26. Oracle 10g driver throws java.sql.SQLException: OALL8 is in an inconsistent state Web    coderanch.com

i downloaded the latest Oracle Database 10g Release 2 (10.2.0.1.0) JDBC Drivers (ojdbc14.jar) but still i get the error. is there some problem with the weblogic server since i updated the library in my code and the database is 10g, but looks like there needs to be something done in weblogic to check the connection pool which i am using to ...

27. java.lang.ClassCastException: oracle.sql.CLOB    coderanch.com

Hi, I am getting this error when I try to use oracle.sql.CLOB Any help would be greatly appreciated Here is my code (Inside DB.java) public boolean updateClob(String selectstmt, String val) throws SQLException { if (selectstmt.equals("")) return false; try { Statement selStmt = conn.createStatement(); selStmt.executeQuery(selectstmt +" for update"); ResultSet rsc=selStmt.getResultSet(); if (rsc.next()) { oracle.sql.CLOB clob = (oracle.sql.CLOB)rsc.getClob(1); //get output stream from the ...

29. Class Cast exception in oracle.sql.ArrayDescriptor    coderanch.com

Hi All We are using Oracle Types to pass the list of data to store procedure.We are getting class cast exception while using the connection pool of websphere .FOllowing is the code connection=myDatasource.getConnection(); cs = connection.prepareCall("{call temp_list(?)}"); System.out.println("Prepare statement is formed"); oracle.sql.ArrayDescriptor descrip = oracle.sql.ArrayDescriptor.createDescriptor("MY_LIST",connection); oracle.sql.ARRAY a = new oracle.sql.ARRAY(descrip, connection, s); cs.setArray(1,a); cs.execute(); We are getting class cats exception at ...

31. not able to cast like (oracle.sql.CLOB) callableStatement.getClob(int value)    coderanch.com

Hi All, I am working on upgrading my project from Weblogic6.1 to Weblogic9.1 application server. I am getting null when I cast it like oracle.sql.CLOB costingClob = (oracle.sql.CLOB) callableStatement.getClob(value); even though the callableStatement.getClob(value) is returning me an object it is not null. The same working working fine with Weblogic6.1, it is failing with Weblogic9.1. My database is Oracle8.i. Can any one ...

32. Oracle sql    coderanch.com

Sudha, Why not do a join and create the comma separated value list in Java? Since you posted in the JDBC forum, I assume you are using Java. If not, you could use an Oracle specific function. Pivot() was introduced recently to help with this. I'm sure there are other similar functions that accomplish this. If you really need something Oracle ...

34. Method similar to decode function in Oracle SQL    coderanch.com

I am looking for methos similar to decode function in Oracle SQL. What I want to do is, int i =0; if (S.indexOf("P")= -1) i = 10000 else i = S.indexOf("P") I will like to do it in one line instead like, int i= decode(S.indexOf("P"),-1,10000) Is there any such method in any class that I can use here? Thanks!! [ July ...

35. java.sql.Timestamp to Oracle date    coderanch.com

This is the insert, need more info? toAgent.executeUpdate("insert into EG_VENDOR (VENDOR_NUMBER, CREATION_DATE, INTERFACE_DATE, INTERFACE_STATUS, VENDOR_NAME, VENDOR_TYPE_LOOKUP_CODE, VENDOR_END_DATE_ACTIVE, VENDOR_SITE_ID, VENDOR_SITE_CODE, VENDOR_SITE_END_DATE_ACTIVE, ADDRESS_LINE1, ADDRESS_LINE2, ADDRESS_LINE3, CITY, STATE, ZIP, AREA_CODE, PHONE, FAX_AREA_CODE, FAX_PHONE, VENDOR_CONTACTS, LAST_UPDATED_BY) values ( '"+ rs.getString(2) +"', '"+ rs.getTimestamp(3) +"', '"+ rs.getTimestamp(4) +"', '"+ rs.getString(5) +"', '"+ rs.getString(6) +"', '"+ rs.getString(7) +"', '"+ rs.getTimestamp(8) +"', "+ rs.getInt(9) +", '"+ rs.getString(10) + ...

37. oracle sql - case statement and count    coderanch.com

Hi All friendly people I have 2 tables table1 and table2 table 1 and table 2 have got ids. my condition is , if table1.id=table2.id then i will need the count on the table2 ids, else if table1.id is not present in table2.id then for the table1.id the count should be 0. This is what i have done so far. select ...

39. Package oracle.sql does not exist    coderanch.com

I'm attempting to compile a java file - this is a simple compile - no eclipse - I'm using notepad for testing java concepts (accessing Clob data). That said when attempting to compile my code I'm getting error messages indicating: C:\JFiles>javac CLOBFileExample.java CLOBFileExample.java:37: package oracle.sql does not exist import oracle.sql.*; ^ CLOBFileExample.java:40: package oracle.jdbc does not exist import oracle.jdbc.*; ^ CLOBFileExample.java:230: ...

40. java.sql.SQLData - Oracle object mapping problem    coderanch.com

Hi guys, I am using java.sql.SQLData interface to map my java objects to Oracle database types. For example, I have an object type Person in Oracle DB defined as: CREATE OR REPLACE TYPE PERSON AS OBJECT ( PERSON_ID NUMBER, PERSON_NAME VARCHAR2(100) ); Corresponding Java type is: public class Person implements SQLData { private String sql_type = "PERSON"; private int personId; private ...

41. Verbose and Constructive SQL Exception error messages using Oracle?    coderanch.com

Hi, Very new to Java (2 weeks) and have most of my background in Perl and other interpreted languages. Working with Perl and Oracle you get very verbose and particular error message when something goes wrong For example.... DBD::Oracle::st execute failed: ORA-01722: invalid number ( DBD ERROR: error possibly near <*> indicator at char 28 in ' SELECT foo FROM bar ...

42. scrambling data in db - oracle sql    coderanch.com

Since you're not likely to do a range query on SSN and your scramble technique will produce duplicates eventually, just set them all to the same value. Also, one doesn't usually base test data on a permutation of production data as in many data sets the unique customers information can still be determined. Every company I've worked with required test data ...

43. Oracle10g: java.sql.SQLException: Invalid Oracle URL specified    coderanch.com

Hi All, I am using the below code but I am unable to connect to the database. Its throwing an error "Invalid Oracle URL specified" DB: oracle 10g OS: Windows Vista jar : ojdbc14.jar Below is the code, please help me import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.DriverManager; import java.sql.SQLException; import oracle.jdbc.pool.OracleDataSource; public class Test { static Connection con = null; public ...

44. Query and sub query question in Oracle SQL.    coderanch.com

I have a Employee table in Oracle. It has all the employees and their salaries listed. The Employee table has following columns: Employee_ID as PK Employee_Name Salary ... I need to create a query that list the salaries in desc order with the employee count with each of the salaries. I think I need to get the distinct salaries first in ...

45. Java Program to Convert Oracle database to a single SQL file.    coderanch.com

There are few tools that convert sql tables to a single XML file. My database may not big as big as 4-5 tables, but I want to produce a program that can flatten tables and convert them to a XML file (or store them in a XML file) I do not have any dependencies as each of the tables are independent. ...

46. Oracle sql exception:    coderanch.com

Hi I have written the following servlet program. package com.nitish.servlet; import javax.servlet.*; import java.io.*; import java.sql.*; import oracle.sql.*; public class SubmitServlet extends GenericServlet{ public void init()throws ServletException{ try{ Class.forName("oracle.jdbc.driver.OracleDriver"); }//try catch(Exception e){ throw new ServletException("Unable to Load the Driver"); }//catch }//init public void service(ServletRequest req,ServletResponse res)throws ServletException,IOException{ String name=req.getParameter("name"); String phno=req.getParameter("phno"); String college=req.getParameter("college"); String university=req.getParameter("university"); String email=req.getParameter("email"); String course[]=req.getParameterValues("course"); Connection con=null; ...

47. Testing a simple Oracle PL SQL function using toad sql client?    coderanch.com

Hi, I'm new to Oracle PL SQL. there is a function which I need to test. I just need to check the result by printing its output on console by passing few parameters. I'm using Toad here as oracle sql client. Function which needs to be tested is as follows:- CREATE OR REPLACE FUNCTION FETCH_ORDER_PRODUCT_DATA( orderNumber IN VARCHAR2, customerNumber IN VARCHAR2, ...

48. need help with executing sql files on oracle    dbforums.com

hi all. does anyone know how to execute a whole sql file on an oracle db with java? i know there are executeQuery() for Queries and executeUpdate() for DDLs but they are for a single SQL statement only. a sql file contains dozens of commands like creating tables, triggers, constrains, packages, procedures, functions, etc. and INSERT, UPDATE, etc. commands and i ...

49. [Oracle 8i] How to get back the SQL statement from a PreparedStatement?    dbforums.com

I am using the driver downloaded from Oracle offical homepage to connect to a Oracle 8i database. When I call the PreparedStatement.toString(), I can't get back the SQL statement as I could when using mysql. What method in Oracle's implementation of PreparedStatement can I call to get back the SQL statement encapsulated??

50. oracle.xml.sql.OracleXMLSQLException    java-forums.org

Hi, We are trying to use the connection from datasource created based on db pool in weblogic 9.2 instance, in an XSQL page, that connects to an Oracle database. Previoulsy it is working fine with iplanet server. Now by deploying the same application in the weblogic server, when we are trying to access the XSQL page we are getting an error ...

51. Download Oracle SQL Plus for JDBC    forums.oracle.com

52. java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle]    forums.oracle.com

I have just installed Oracle8i and i m trying to connect a project to d database using ODBC. I gave Driver class name as sun.jdbc.odbc.JdbcOdbcDriver Connection Info as jdbc:odbc:dbgen dbgen is my project name Database name as Oracle Username as scott Password as Tiger i am getting this exception java.sql.SQLException[Microsoft][ODBC Driver for Oracle][Oracle] can ne one help me out plz???

53. SQL database move to Oracle    forums.oracle.com

Now what I need is now convert the connection string to connect to a converted Oracle Database. I have all the needed parameters such as the username, password, database name, ip address, etc. Do I just change the driverClassName for this to an oracle string for me to connect to the new database? Need expert advice, thanks!

54. Oracle SQL developer configuration file    forums.oracle.com

56. how to connect from oracle sql developer ?    forums.oracle.com

58. java.sql.SQLException: ORA-06502 accessing oracle CLOB    forums.oracle.com

END getDesc; JAVA (This below code may miss some bits and pieces here and there, but its working good with low amount of data: TESTED) ======================================================== public void getClob throws SQLException { try { // data type that we expect the proc to return int returnType = OracleTypes.VARCHAR; Object retValue; DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@server:1521:XXXX", "XXXX", "XXXX"); CallableStatement ...

59. java.sql.SQLException: ORA-06502 accessing oracle CLOB    forums.oracle.com

Hi, Here is the Stack Trace. NOTE:You may see OraProcValue.java and ShoClob.jsp in the stack trace, I have the getClob method in the OraProc.java class and calling this in ShoClob.jsp. It throws an error just after calling the cs.executeUpdate() statement. (fails on calling this statement) Like mentioned earlier it works if I execute the oracle procedure directly on oracle. I doubt ...

60. count number of rows from oracle and sql database and generate a report    forums.oracle.com

Hi All, Can someone help me in writing a java program for the following scenario? 1. Read the number of rows available from oracle table and print the total row count in a Report.txt text file. 2. Read the number of rows inserted in a sql database (after a specific process-just an information) and print the total row count in the ...

61. package oracle.sql does not exist    forums.oracle.com

Connection conn=null; Statement stmt=null; public void insert(String[][] Indata,String Tabname,int m,int n1) //public void insert(String Tabname) { Connection conn=null; try { //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); //Class.forName("oracle.jdbc.driver.OracleDriver"); //conn =DriverManager.getConnection ("jdbc:oracle://oci8:/@mohan","SCOTT","TIGER"); String username = "SCOTT"; String password ="TIGER"; String url="jdbc:odbc:mohan1"; //String url= String driver="sun.jdbc.odbc.JdbcOdbcDriver"; Class.forName(driver); conn=DriverManager.getConnection(url,"SCOTT","TIGER"); conn.setAutoCommit (false); //conn =DriverManager.getConnection ("jdbc:oracle://oci8:/@mohan","SCOTT","TIGER"); //conn.setAutoCommit(false); } catch(Exception e) { System.out.println(e); } try { String s1=Tabname+"n"; String s=Tabname+"m";

62. Package oracle.sql does not exist    forums.oracle.com

Connection conn=null; Statement stmt=null; public void insert(String[][] Indata,String Tabname,int m,int n1) //public void insert(String Tabname) { Connection conn=null; try { //DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver()); //Class.forName("oracle.jdbc.driver.OracleDriver"); //conn =DriverManager.getConnection ("jdbc:oracle://oci8:/@mohan","SCOTT","TIGER"); String username = "SCOTT"; String password ="TIGER"; String url="jdbc:odbc:mohan1"; //String url= String driver="sun.jdbc.odbc.JdbcOdbcDriver"; Class.forName(driver); conn=DriverManager.getConnection(url,"SCOTT","TIGER"); conn.setAutoCommit (false); //conn =DriverManager.getConnection ("jdbc:oracle://oci8:/@mohan","SCOTT","TIGER"); //conn.setAutoCommit(false); } catch(Exception e) { System.out.println(e); } try { String s1=Tabname+"n"; String s=Tabname+"m";