Rajasekhar Devi Reddy

Greenhorn
+ Follow
since Dec 21, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Rajasekhar Devi Reddy

Depending on your JBOSS version DI in servelets might not work. At least in my case DI in servlets did not work for JBOSS version 4.2.3 so I changed my code to do a JNDI look up.
Are you talking about maintaining an application configuration? If that is so, I would do it this way..

Have a class that provides methods to read application configuration properties, like config.getproperty(propertyName). All the classes that need to read some property will call this method.

The class constructor is private and read the properties file here. Class will have a private variable that holds its own instance.

Other objects of the application obtain an instance of this class by calling a static method Configuration.getInstance(). This method returns the local variable that we talked about above.

write a method to reload configuration that makes the local instance variable null and re creates it . Call this method when ever a change is made to your properties file.

Hope it helps.

Hi all,

I have a tabla with a CLOB column in it and I need to be able to retrieve this clob value, along with others, using JDBC and create an XML. I did a performance test with this and found that just to read through a result set of 900 rows with one CLOB column in each, is taking 7 seconds.

My query goes like this


But if I change the query to

(** I know for this set of where clauses the size of the clob wont be too large that it can't fit in CHAR).

the time is down to one second or less. So the colb actually returns a locater and then JDBC will read the actual data when I call read on that column, resulting in 900 read operations taking too much time. Having the data converted to CHAR right in the SQL gives me great performance benefits. But I can not do it all the time as in some cases the value might not fit in CHAR and Oracle throws an exception.

Is there a way that I can read the actual data instead of retrieving a pointer to the CLOB data? Or is there any way of reading these CLOBS faster? I tried calling just rs.getString() (works with 10g & above) and also tried with and read a char stream. Both take some 6 to 7 seconds to loop through 900 records.

I would be thankful if some one who had seen this before cold suggest a better way or point me to right resources.

Thank you
Raj.
Great ..... I was using System class loader and was having problems read the pros..changing it to current thread's works perfect. Thank you!!
15 years ago
Hey wisu all a very happy new year fellows...thanks for all the support and information that you share with us.
16 years ago
Thank you verymuch Gamini Sirisena, for the response I will try things that you have suggested.
16 years ago
Hi

I am trying to write a code that acepts a url (can be any protocol) and tests if the URL is accessible(either to read or to write).

Because I dont know what the protocol is I just used java.net.URL to accept a url, created URLConnection by callong url.openConnection() and then made a connection by calling



if an exception is fired I print out that the connection could not be made.

Now my question is, my assumption that above code not returning exception will imply a connection that can be used to either read or write, correct ?

what if the url requires a user name and password ?

and I dont see a method to close the connection in API for URLConnection. Is it fine because the host on the other end closes connection after certain period of inactivity? is it true for any protocol ?
16 years ago
This should work with the same javac and java commands as listed in the reply above if you are working from c:\
your package statement in the new class should be

package com10.TestPkg.Internal;

then your import statement in the test1 class should be

import com10.TestPkg.Internal.test3;

when you say this the compiler looks for for the structure com10\TestPkg\Internal

and there it finds the file test3.class

this should work.
Yeh coz the classname.variable name is used you are refering to the static variable declared globally.


[ October 13, 2008: Message edited by: Rajasekhar Devi Reddy ]
[ October 13, 2008: Message edited by: Rajasekhar Devi Reddy ]
Thq for reply guys!! (in this thread and in the other)

I some how still can not figure out why the code did not work on JBOSS. I tried runniong it Glassfish . I used NetBeans - Glassfish combination and the very same code worked with it. Dont know why it won't work with JBOSS.

I am still trying to find ways to check if my lib folder has all the necessary jars. Does any one know hot to check it? Or what else might be the problem ?
16 years ago
Hi

I got it to work with this code.. Just posting it to help others if having the same problem.

16 years ago
Hi,

I am new to servers and server side programming. I have been trying to run a message driven bean using JBoss with out success for quite some time now. So I decided to try it on netbeans and Glassfish server that comes bundeled with it.

Now my question is. To write a client to access a MDB i need to access InitialContext to perform JNDI lookup.

in JBOSS I did it using this code



I am trying to find out what would be similar kind of properties entry for glassfish.

any sugestion would be of great help.

thank you
16 years ago