sridhar gandikota

Ranch Hand
+ Follow
since Jul 09, 2008
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
2
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sridhar gandikota

After doing a bit of search based on Bears comments on how the PUT request works and also some stuff about the HttpURLConnection.

1) I came to know that we cannot directly access files on the servers and change its contents (magically )
2) I ran some sample programs to understand the concept.

Thanks for guidance Bear and Pat. You guys are simply super, you made my concepts about request methods to be corrected.
10 years ago
I just wanted to post some content to file in the URL using java. just wanted to know whether its possible ?

10 years ago
Thanks Bear Bibeault for your prompt reply.

But what I am trying to do is something like this



java.io.BufferedInputStream in = new java.io.BufferedInputStream(new java.net.URL("http://localhost:9090/test/test.txt";).openStream());
java.io.FileOutputStream fos = new java.io.FileOutputStream("http://localhost:9090/test/test1.txt";);

java.io.BufferedOutputStream bout = new BufferedOutputStream(fos,1024);
byte data[] = new byte[1024];
while(in.read(data,0,1024)>=0)
{
bout.write(data);
}
bout.close();
in.close();




In other words I want to implement poster plugin for firefox browser in java program is this possible
10 years ago
Hi Ranchers,

I am fairly new to the PUT request method.

I am trying to access file from the url and write some content to the file using PUT request method.

Here is my main method



here are my questions:

1) is there any limit on number of characters to PUT request like GET
2)This program is not working can you please let me know what is the wrong with code
3)If I access the file using PUT request should I write the data in chunks(shown in comments) or can I write the data at one full stretch like I have shown above.

With Regards,
Sridhar
10 years ago
Thanks Paul,

I guess I have to use tool to search the whole code .


Regards,
Sridhar
Hi Anton,

Sorry for my "explaining words" .

I wanted to know is there any way where I could get to know there number of open connections open by a program and so that I can go to that class and put code like connection.close() so that it will solve the open connection issue.

Regards,
Sridhar
If we have class A has opened Connection through connection object and has not closed and similarly with Class B,Class C etc

What I want is

Class Name Connections Open
Class A 1
Class B 2
Class C 3

Something like this.

Please let me know if this is possible through program or is it possible through with the Admin module of server?

With Regards,
Sridhar
Thanks Jan and Anton for your prompt reply.

Anton,

Any possibility that web server or app server which can do this job?

Regards,
Sridhar
Hi Ranchers,

I have two question in JDBC

1) When a connection is created like in below program , if we close connection object wont it be enough why should we close resultset,statement and connection all three.
2)Can we know which class file has kept the connection open(if there are any open connections).Can we write a small program for that?




Regards,
Sridhar
Hello Ranchers,

I want to know can I run two resultsets in two seperate threads i mean one resultset in one thread and the other in other thread?

I just want to speed up execution of sql queries . By this process Can I improve the output performance?

DB is oracle 10g.

Please let me know if this is possible?

If so can you please provide with a Example please....

With Regards,
Sridhar
12 years ago
Not with the sql . For example there are 2000 rows in a table and i need to display on the page when iterate


Statement stmt = connection.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM my_table");
String tableString="<table>";
while(rs.next()){
tableString+="<tr>"+"<td>"+rs.getString(1)+"</td>"+"<td>"+rs.getString(2)+"</td>"+"</tr>";
}
tableString+="</table>";

httpServletResponse.setContentType("application/vnd.ms-excel");
httpServletResponse.setHeader("Content-disposition",
"attachment;filename=\"example.xls\"");
httpServletResponse.getWriter().write(tableString);

This is taking lot of time.

Please correct anything wrong in this piece of code.

Or is there any other simple way
12 years ago
Hi Rancher,

I have problem in exporting the large amount of data to excel. There are around 2000 rows or more. When I use resultset iterate through each row is taking lot of time. Can you please help in solving problem.

Is there any way such that PL/SQL procedure will print the html table tags combined with DB values comes out as string output. Then exporting that string to response printwriter? . Is it correct way?

OR is there any other way in java itself to handle this condition.

Please help me Ranchers.

With Regards,
Sridhar
12 years ago
Hi Ranchers,

Below is the program for placing the image in excel but i am not getting image of its actual size it is placed well inside in a cell of workbook. Can you please tell me how can I put the image such that if I open the excel I can see the image of its original size or even i am fine with enlarged image too . Please help me ranchers

Hi JaiKiran,

You are great. It saved me .Thanks a lot.

Even I went through your blog it is good.

With Regards,
Sridhar
13 years ago
Hi Ranchers,

When installed jboss on linux machine it works fine but when I install on Solaris 10 its failing. It give me below error.Please help on this





10:39:39,747 INFO [ServerInfo] VM arguments: -Dprogram.name=run.sh -Xms128m -Xmx512m -XX:MaxPermSize=256m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djava.endorsed.dirs=/home/apachedev/download/jboss-5.1.0.GA/lib/endorsed
10:39:39,995 INFO [JMXKernel] Legacy JMX core initialized
10:39:53,154 ERROR [AbstractKernelController] Error installing to Instantiated: name=AttachmentStore state=Described
java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]
at org.jboss.reflect.plugins.introspection.ReflectionUtils.handleErrors(ReflectionUtils.java:395)
at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:153)
at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:106)
at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:80)
at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.createTarget(AOPConstructorJoinpoint.java:282)
at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:103)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:241)
at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:109)
at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:70)
at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:774)
at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:540)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:319)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:297)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130)
at org.jboss.kernel.plugins.deployment.BasicKernelDeployer.deploy(BasicKernelDeployer.java:76)
at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:91)
at org.jboss.bootstrap.microcontainer.TempBasicXMLDeployer.deploy(TempBasicXMLDeployer.java:161)
at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:138)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:595)
Failed to boot JBoss:
java.lang.IllegalStateException: Incompletely deployed:

DEPLOYMENTS IN ERROR:
Deployment "AttachmentStore" is in error due to: java.lang.IllegalArgumentException: Wrong arguments. new for target java.lang.reflect.Constructor expected=[java.net.URI] actual=[java.io.File]

DEPLOYMENTS MISSING DEPENDENCIES:
Deployment "ProfileService" is missing the following dependencies:
Dependency "jboss.kernel:service=KernelController" (should be in state "Installed", but is actually in state "**ERROR**")
Dependency "ProfileServiceDeployer" (should be in state "Installed", but is actually in state "Instantiated")
Deployment "ProfileServiceBootstrap" is missing the following dependencies:
Dependency "ProfileService" (should be in state "Installed", but is actually in state "Instantiated")
Dependency "jboss.kernel:service=Kernel" (should be in state "Installed", but is actually in state "**ERROR**")
Deployment "ProfileServicePersistenceDeployer" is missing the following dependencies:
Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")
Deployment "ProfileServiceDeployer" is missing the following dependencies:
Dependency "AttachmentStore" (should be in state "Installed", but is actually in state "**ERROR**")

at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)
at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)
at org.jboss.bootstrap.microcontainer.ServerImpl.doStart(ServerImpl.java:142)
at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:450)
at org.jboss.Main.boot(Main.java:221)
at org.jboss.Main$1.run(Main.java:556)
at java.lang.Thread.run(Thread.java:595)
10:39:58,701 INFO [ServerImpl] Runtime shutdown hook called, forceHalt: true
10:39:58,752 INFO [ServerImpl] Shutdown complete
Shutdown complete
Halting VM




It would be of great help to me if you could give me the solution
13 years ago