Win a copy of Rust Web Development this week in the Other Languages forum!

Prashanth menon

Ranch Hand
+ Follow
since Feb 20, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Prashanth menon

Ok I got rid of the exception now.
It was because I had missed out on the default constructor.
Prashanth
I created an oracle object. Created a java class that implements java.sql.SQLData.
By overriding the writeSQL method I was able to pass to the data base the object.
The reverse did not work.

When I tried to retreive the sql array and subsequently the object out of the array (casted as "Sample") the following exeception occurs
java.sql.SQLException: Inconsistent java and sql object types
Can anyone give some pointer to the possible solution.
thanks
Prashanth
The section that sounds interesting is
Extending Eclipse, the plug-in architecture, and Eclipse frameworks.
I like this opportunity to compete for the book.
Just missed out something in the earlier posting.
The SWT docs are available in Eclipse plugin folder.
For Eclipse2.1 this is in org.eclipse.platform.doc.isv_2.1.0 as a zip file named "doc.zip".
Prashanth
If you are thinking of developing an Eclipse plugin, I suggest you should visit the link
Developing Eclipse plug-ins
If its SWT javadoc that you are talking of I also am unaware.
Prashanth
I have been using eclipse for the past one year. Some how this seems to be a better IDE.
The project I am working on is on EAI. Hence these are core java programs interfacing with IBMQSeries.
So as such I donot know the benifits of using Eclipse for a GUI application. Though Eclipse is built using SWT and also has the library for the same, I have not found any plugin that provides a drag and drop environment.
One of the benifits of Eclipse is the plugins available. We use VSS plugin and Database plugin.
I have tried the Omondo plugin for UML. But this made the application heavy. Other wise this is not as sluggish as other Java IDEs
Hi all,
I tried passing ARRAY object from java to oracle which in turn returns another array. This worked with the thin connection. But when I used Connection pooling of Websphere, this failed. Throws me out at the point where I create the ArrayDescriptor object. The Code is as follows.
String[] strArrayr={"12","13","14"};
//DATA_1_COL_TY is an oracle collection type and con is a Connection object.
ArrayDescriptor arrVarcharDesc=ArrayDescriptor.createDescriptor("DATA_1_COL_TY", con);
ARRAY arr = new ARRAY(arrVarcharDesc, connectionDb, strArrayr);
OracleCallableStatement callStmt = (OracleCallableStatement) con.prepareCall(
"{ call get_orders(?,?)}");
callStmt.setArray(1, arr);
callStmt.registerOutParameter(
2,
OracleTypes.ARRAY,
"DATA_2_COL_TY");
….
The exception raised is
java.lang.ClassCastException: com.ibm.ejs.cm.proxy.OracleConnectionProxy
Is it by any chance possible to implement the above using a connection pooling in websphere. Looks like it is possible in Oracle AS.
Thank you
Prashanth
18 years ago
I tried passing ARRAY object from java to oracle which in turn returns another array. This worked with the thin connection. But when I used Connection pooling of Websphere, this failed. Throws me out at the point where I create the ArrayDescriptor object. The Code is as follows.

String[] strArrayr={"12","13","14"};
//DATA_1_COL_TY is an oracle collection type and con is a Connection object.
ArrayDescriptor arrVarcharDesc=ArrayDescriptor.createDescriptor("DATA_1_COL_TY", con);
ARRAY arr = new ARRAY(arrVarcharDesc, connectionDb, strArrayr);
OracleCallableStatement callStmt = (OracleCallableStatement) con.prepareCall(
"{ call get_orders(?,?)}");
callStmt.setArray(1, arr);
callStmt.registerOutParameter(
2,
OracleTypes.ARRAY,
"DATA_2_COL_TY");
….
The exception raised is
java.lang.ClassCastException: com.ibm.ejs.cm.proxy.OracleConnectionProxy
Is it by any chance possible to implement the above using a connection pooling.
TIA
Prashanth

Originally posted by Bikash Paul:
Hi Prashanth,
I mean DSN less connection when we connect database through driver and using driver,user,password,Data Source and DSN connection means when we connect database through bridge connection(JDBC-ODBC)then we use DSN,user,password.I want to know that Is there any advantages and disadvantages one over other or both connections are same.
Regards
Bikash


The driver is always required to communicate to the database. The only quetion is what kind of driver. Yes native drivers are faster than the bridge.
Further if it is thin driver it directly communicates with the DB listener.
Example
Connection conn =
DriverManager.getConnection ("jdbc racle:thin:@machine:1521 bmsname",
"scott", "tiger");
As you can see we directly give the port number and ip address.
But there are some features (in oracle it might not support heavy transactions)
regards
Prash

Originally posted by Rob Levo:
I am confused what the proper way to insert into a Date field. Sybase is the database.
Sould I format the date as a string that Sybase will except as a Date, or is there a better approach.
If someone could provide a simple example of doing an insert into tablename ...... where one of the fields is of type Data, that would be very, very helpful.
Thanks in advance.
Rob


Hi rob,
I have no Idea if Sybase uses a particular format for date inserts. But you can always use prepared statements I suppose.
PreparedStatement pstmt =
conn.prepareStatement ("insert into EMP (EMPNO, ENAME) values (?, ?)");
pstmt.setInt (1, 1500); The first ? is for EMPNO
pstmt.setString (2, "LESLIE");// The second ? is for ENAME
If Date is one of the fields. we can use
pstmt.setDate(1,date);
date is a java.sql.Date object.
It works with oracle. I think its no different for Sybase
Hope this would help.
regards
Prash.
I am not sure what you mean by DSN less connection.
Basically I think its the driver types that the issue is about.
One of the methods used to connect to database would be a Bridge connection (JDBC-ODBC). Here you would be using a DSN name. You can also use native drivers provided by the database vendor like oci driver of oracle. There can also be pure native drivers. In this case as is Oracle Thin Driver, we communicate directly to the database process. Either way the connection string used in each case may be called as a Data Source.
Prash
Hi
I am using CallableStatements . The Oracle object I have is testobjtype and the package is testpkg. How do I register the outParameter of a varray type? I am getting error when I create a ArrayDescriptor ...

The code is below.

OracleCallableStatement callableStatement = (OracleCallableStatement)
con.prepareCall ("{ ? = call TESTPKG.testf(?)}");

callableStatement.setString(2, "test");

Object elements[] = new Object[20];

ArrayDescriptor desc = ArrayDescriptor.createDescriptor("TYPE_VARRAY", con);
/*
I tried with this also
ArrayDescriptor desc = ArrayDescriptor.createDescriptor("testobjtype", con);
*/

ARRAY newArray = new ARRAY(desc, con, elements);
callableStatement.registerOutParameter(1, OracleTypes.ARRAY, "newArray");
callableStatement.execute();

ResultSet rs = (ResultSet)callableStatement.getObject (1);

ERROR:
SQLException java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
java.sql.SQLException: invalid name pattern: TEST.TYPE_VARRAY
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
at oracle.jdbc.oracore.OracleTypeADT.initMetadata(OracleTypeADT.java:424)
at oracle.jdbc.oracore.OracleTypeADT.init(OracleTypeADT.java:343)
at oracle.sql.ArrayDescriptor.initPickler(ArrayDescriptor.java:1002)
at oracle.sql.ArrayDescriptor.<init>(ArrayDescriptor.java:132)
at oracle.sql.ArrayDescriptor.createDescriptor(ArrayDescriptor.java:97)
at com.busch.wms.interfaces.TestVarray.main(TestVarray.java:75)
Hi
I have some doubts about saving xml file using java. Suppose I have to delete an element in an xml file and then save it using an application, how do I do it?
Say that I store messages to a particular user in xml format. Once the user reads it he can delete it.
regards
Prashanth
I think packaging the dll with the application should solve the problem. May be this Library is required to run the cafe created exe.
This is the case with most ide. VB, VC also uses such dlls that are to be bundled with the application created.
Prashanth
19 years ago
You may visit the following link
Summary of New Features and Enhancements in Java2 SDK 1.4
Rgds
Prashanth
19 years ago