Bharat Agarwal

Greenhorn
+ Follow
since Jun 16, 2001
Merit badge: grant badges
For More
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 Bharat Agarwal

Hi all,
I am getting the protocol violation error when I am trying to get the connection Object using getConnection method.........i m using jdk1.3 and oracle 8.1.7 and linux server.....and the driver i m trying to use is all java thin driver......i tried all the possible ways but could not get rid of the error....it is driving me nuts.....help is badly needed........
-Bharat
Well, I am using thin driver and the error I am getting is Protocol Violation error. it is SqlException:Procotocl Violation error and it occurs when I want to establish a Connection Object. Hope this helps and you may be able to help me out.
-Bharat
Hi all,
When I try to connect to the Oracle 8.1.7.0.0 using java applets and jbbc, I get this error. Can any one help me out please...thanx is appreciated...
Hi all,
I am trying to retreive a blob from the oracle 8.1.6.0.0 using jdk1.3. I tried most of the method's as per the API but could not get any result.
blob = (java.sql.Blob) rs.getObject(3);
InputStream in = blob.getBinaryStream();
byte[] b_blob = new byte[blob.length()];
b_blob = in.getBytes(1, blob.length());
// length = blob.length();
// txtfield.append("Length of blob : " + length);
Is there any other way out to retreive the blob. I have tried get Blob method as well. Moreover, I am not able to print the length of the blob as well.
I was able to insert the blob in the oracle database but could not check it exactly what is going in. As I tried to import the table in MS Access, it give me long binary data(AS MS access does not have objects). Can any one please, help me in how to check what is inserted in the table and also how to retreive the blob....Sample code is most welcome.
tia.........
if i m not wrong then you have to use the StringTokenizer class....Go to through that class and you will be able to find the methods to use the delimiter that you want...Hope this may help !!!
22 years ago
Thanx guys,
I did tried all this methods that you had advised before posting the question. I however got rid of that error but I am in the other error now.. I tried to make an binary file of all the pixel values and then try to insert that binary file into the BFILE column of the database. And when I try to read the name of the file entered, it gives some weird name as oracle.sql.bfile@anw34 something of this kind. Also, when I try to use the sql methods( .FileExists() or .FileOpen()), it says that the file of the directory doesnot exists for this operation.
Is this problem something that is related to the server setting. The server that I am working on is Linux Mandrake 7.2. i am able to insert all other type of datatype in the database, but when it comes of using of blob or Bfile, I am stuck as it gives me all kinds of error which I am not able to handle. If you guys or any one else have any suggestions, I would really appreciate. I am ready to send all the code, if that helps to answer my question....
Thanx a lot in advance....
Bharat.
Hi all,
I want to create a binary file with the appropriate extension so that I can insert this binary file in BFILE column type of the oracle database. A sample code would be a highly appreciated.
TIA......Bharat...
22 years ago
The detailed error message is :
java.sql.SQLException: Exhausted Resultset
at java.lang.Throwable.fillInStackTrace(Throwable.java:native)
at java.lang.Throwable.<init>(Throwable.java:38)
at java.lang.Exception.<init>(Exception.java:24)
at java.sql.SQLException.<init>(SQLException.java:22)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:114)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:156)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:219)
at oracle.jdbc.driver.OracleStatement.prepare_for_new_get(OracleStatement.java:2289)
at oracle.jdbc.driver.OracleStatement.getStringValue(OracleStatement.java:2434)
at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:285)
at TestProject.action(TestProject.java:393)
at java.awt.Component.handleEvent(Component.java:570)
at java.awt.Component.postEvent(Component.java:935)
at java.awt.Button.process(Button.java:205)
at java.awt.ActionEvt.dispatch(ActionEvt.java:16)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:39)
Hi, I am trying to insert and retreive an Bfile into an oracle database and i get the error as stated above. Can someone help me out please, what does that error means. I am sending the code hereby :

I add the ubb code tags for easier reading. -- Carl

[This message has been edited by Carl Trusiak (edited August 14, 2001).]
Hi,
I want to access (store and retreive) a text file in BFile (large file) in the oracle database. Can any one help me please. The sample code would be really appreciated.
Thanks in advance.
here is the error that it is giving meIn the if loop
in the try loop
qqqqqqqq
java.lang.NoClassDefFoundError: oracle/sql/BLOB
at oracle.jdbc.driver.OracleStatement.getBinaryStreamValue(OracleStatement.java:3626)
at oracle.jdbc.driver.OracleResultSetImpl.getBinaryStream(OracleResultSetImpl.java:375)
at oracle.jdbc.driver.OracleResultSet.getBinaryStream(OracleResultSet.java:1488)
at TestProject.action(TestProject.java:309)
at java.awt.Component.handleEvent(Component.java:570)
at java.awt.Component.postEvent(Component.java:935)
at java.awt.Button.process(Button.java:205)
at java.awt.ActionEvt.dispatch(ActionEvt.java:16)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:39)

I could not understand y it is not going ahead of the BufferedInputStream method....

Thanx in advance.
Hi all,
I am able to insert the blob column in the database. Now, I want to check whether the element is inserted or not and so I am trying to retreive the bolb through JDBC. But it is giving me the error. I tried to check it out in as many ways as possible by me. Can someone look into it and reply back. I will greatly appreciate that. Thanks,Statement sment=conn.createStatement();
ResultSet rs = sment.executeQuery(sql);
String returndata=null;
txtfield.append("HI");
if (rs.next()) {
System.out.println("In the if loop");
try {
System.out.println("in the try loop");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
System.out.println("qqqqqqqq");
BufferedInputStream bis = new BufferedInputStream(rs.getBinaryStream("XYCOORD"));
System.out.println("aaaaaaaaaaaa");
byte[] bindata=new byte[1024];
System.out.println("aaaaaaaaaaaa");
int bytesread = 0;
System.out.println("In the try loop");
if ((bytesread = bis.read(bindata,0,bindata.length)) != -1) {
baos.write(bindata,0,bytesread);
}
else
{
returndata=baos.toString();
}
System.out.println("Before the try loop");
txtfield.append("HI");
// txtfield.append(rs.getString("DRAW_ID"));
// txtfield.append(rs.getString("I_ID"));
// txtfield.append(returndata);
// txtfield.append(rs.getString("MA_DESC"));
System.out.println("Query executed");
// bis.close();
} catch (IOException ioe) {
System.err.println("Problem retreiving binary data : " + ioe);
} catch (Exception cnfe) {
System.err.println("Problem retreiving binary data : " + cnfe);
}
}
rs.close();
this is my code where i want to retreive the blob. XYCOORD is the blob column in the database.
It is very urgent as I need to submit my project as the deadline is appraoching for me(I am a student)
Bharat.
Hi,
Can any one explain the meaning of this error. It occurs when I am trying to insert array into the oracle table. I am able to connect the java applet with the oracle through JDBC, but when i try to insert a array, it gives me above error.
Thanks in advance.
Bharat.
I am a student and want to create an image button in my applet so that it can take up the events. Can some one help me out please. The example code would be a best help.
Thanx a lot.
Bharat
22 years ago
Hi,
I am trying to connect to the ORDBMS using the applet. When I insert an byte array in the Blob field of the database, it gives me "connection reset by peer error". While in Appletviewer, It gives me "IOException:Broken Pipe". Can any one help me please. It is urgent.
Thanx and regards..
Bharat.
22 years ago