Find ouT...
Best viewed in 1024 X 800 resolution... Leave a comment if u like an article...
Google
 
Web tezcols.blogspot.com

Saturday, June 30, 2007

Can't start a cloned connection while in manual transaction mode

While using the Microsoft SQL Server 2000 Driver for JDBC, you may experience the following exception when you try to create multiple Statement objects with same Connection object:
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Can't start a cloned connection while in manual transaction mode.

Add
SelectMethod=Cursor; in the connection string. Thats it..... Let me know if this helped u...

Friday, April 06, 2007

Bookmark using javascript....

< html >
< head >

< script language="JavaScript" type="Text/Javascript" >

var urlAddress = "http://www.talimpu.com";
var visibleName = "Mouth watering recipes...";
function addToFavorites() {
if(window.sidebar) {
window.sidebar.addPanel(visibleName, urlAddress,"");
}
if (window.external) {
window.external.AddFavorite(urlAddress,visibleName);
}

}
< /script >
< /head >

< body>
< a href="javascript:addToFavorites()"> < font color="#0000FF" face="Arial" > Wanna Bookmark me !< /font > < /a >
< /body >
< /html >

Labels:

Saturday, February 24, 2007

javascript to PRINT your webpage....

Many times programmers / web-designers need to print a receipt after a particular transaction... I have found many of them embedding ActiveX control for printing mechanism in their pages... activex control code looks awkward, class id is to be remembered, wil not wrk fine on all explorers....

here is a simple solution.... use
self.print() function in onclick method of a button which prints the page having the button...

The button will be hidden before printing in the code given below....

< html >
< body >

< form name='prnttest' >
this html prints the page... < br/ >< b >hides the button before printing < /br >

< table >
< tr >< td >
1< input type='radio' name='hh' value='1' >
< /td >< /tr >

< tr >< td >
2< input type='radio' name='hh' value='2' >
< /td >< /tr >
< tr >< td >
3< input type='radio' name='hh' value='3' >
< /td >< /tr >
< tr >< td >
4< input type='radio' name='hh' value='4' >
< /td >< /tr >
< /table >

< input type='button' value='Print' onclick="this.style.visibility='hidden';self.print();"/ >
< /form >
< /body >
< /html >

share ur experiences if this helps you....

tezcols

Labels:

Wednesday, February 21, 2007

Log ur activities easily....

for pals who use Windows operating system....

create a notepad file, the one which has .txt as extension on your desktop. Now open the file and write .LOG in the first line. Press enter key after writing. Close the file by saving changes.

If you open the file now, you will find the current date and time followed by a cursor waiting for your log :-) Close n Open Close n Open Close Open.... everytime u can write a log....

tezcols

Labels:

Tuesday, February 13, 2007

TOMCAT IIS CONNECTOR

Is your superior asking you to deploy Java stuff on IIS ? Are you using TOMCAT web server instead ?

uhhhh... don't bother... u got it...

Im gonna tell u connecting tomcat webserver to IIS. Requests that need java engine will be forwarded from IIS to tomcat and get the response without the knowledge of the web user.

I guess u hav

I am using Windows XP and I have

  • J2SDK installed at C:\Program Files\Java\jdk1.6.0
  • Tomcat installed at C:\Program Files\Apache Software Foundation\Tomcat 5.0 with default port 8080 configured.
  • CATALINA_HOME and JAVA_HOME environment variables (System Variables) configured.
  • Make sure that no other application is running on port 80 so that IIS can run on its default port 80. Change the port numbers and make sure of the IIS port number being used.

Extract the connectors-jk2.0.4-win32-IIS.zip and copy isapi_redirector2.dll to TOMCAT_HOME/bin/win32/i386. If you dont have the win32 and i386 folders just create new one and then copy to i386.


To support the JK2 Connector, you might need to edit the jk2.properties file. In most cases though, the default settings adopted by Tomcat are correct and the contents of jk2.properties can remain commented out.You can find jk2.properties in TOMCAT_HOME/conf directory. If you don't have one jus create a file with the name jk2.properties and copy the following text into the jk2.properties file


## THIS FILE MAY BE OVERRIDEN AT RUNTIME. MAKE SURE TOMCAT IS STOPED

## WHEN YOU EDIT THE FILE.

## COMMENTS WILL BE _LOST_

## DOCUMENTATION OF THE FORMAT IN JkMain javadoc.

# Set the desired handler list

# handler.list=apr,request,channelJni

#

# Override the default port for the socketChannel

# channelSocket.port=8019

# Default:

# channelUnix.file=${jkHome}/work/jk2.socket

# Just to check if the the config is working

# shm.file=${jkHome}/work/jk2.shm

# In order to enable jni use any channelJni directive

# channelJni.disabled = 0

# And one of the following directives:

# apr.jniModeSo=/opt/apache2/modules/mod_jk2.so

# If set to inprocess the mod_jk2 will Register natives itself

# This will enable the starting of the Tomcat from mod_jk2

# apr.jniModeSo=inprocess


Now create a file with the name workers2.properties if you dont have and copy the following into the file


[shm:]info=Shared memory file. Required for multiprocess servers

file=C:\Program Files\Apache Software Foundation\Tomcat 5.0\jk2.shm

size=1000000

[channel.socket:localhost:8009]

info=Ajp13 worker, connects to tomcat instance using AJP 1.3 protocol

tomcatId=localhost:8009

[uri:/jsp-examples/*]

info=JSP examples, map requests for all JSP pages to Tomcat.

context=/jsp-examples


The IIS redirects every request to 'context' attribute mentioned above.Requests to

http://localhost/jsp-examples/ (IIS) will be redirected to http://localhost:8080/jsp-examples/ (Tomcat server). You can include more than one context attribute from the next line.

Now some settings to the Windows Registry are to be made so that the redirector will read when it is loaded by the IIS.
create a file with the name isaapi_redirector2.reg preferably in TOMCAT_HOME\bin\win32\i386. Right click and select edit. Copy the following text into it.


Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Jakarta Isapi Redirector\2.0]

"workersFile"="C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0\\conf\\workers2.properties"

"extensionUri"="/jakarta/isapi_redirector2.dll"

"logLevel"="debug"

"serverRoot"="C:\\Program Files\\Apache Software Foundation\\Tomcat 5.0\\"

Before saving make sure that 'workersFile' attribute points to the workers2.properties just created and 'serverRoot' points to your tomcat home directory. Save the file. Again right click and select Merge.

If you dont have IIS installed go to Control panel ---- Add or Remove Programs ---- Add/Remove Windows Components---- enable Internet Information Services (IIS) and install.
Now go to Control panel --- Administrative Tools and launch Internet Information Services.
Expand the tree LOcal Computer and you wil find 'Web Sites'.Right click on it and select 'Properties'. Now select 'ISAPI Filters' tab. Click Add button. Enter the Filter Name (Tomcat Connector) and Browse for isapi_redirector2.dll. Click OK and Apply on ISAPI Filters tab.
Expand the 'Web Sites' node and u wil find 'Default Website'. Right click on it and create a virtual directory with the name 'jakarta' in TOMCAT_HOME\bin\win32\i386. Click Next and ensure that Execute is checked. Click Next.

Set Tomcat Server to auto start. To do this do it through services.exe or right click on the tomcat icon at the taskbar and check Auto start option.
Right click on the 'local computer' node in IIS ---- All tasks --- Restart IIS. Click OK
Thats it......
Try

http://localhost:8080/jsp-examples/ by typing in you explorer.The response given is directly from Tomcat.Now try http://localhost/jsp-examples/ . The same response will be given through IIS.Change the port number in the addresses if required.

Send me a comment if this article helped u...

tezcols


Labels:

Wednesday, November 15, 2006

unselectable attribute in HTML

Hey !! wil u bliv if i say tht HTMl has an attribute named 'unselectable'. This attribute can make an element not to be selectable. Let me tel clearly. 4 suppos u hav a HTML table n a no. of td tags in it. A part of text in a td can be selected by dragging on the desired part. Try settin unselectable="on" in td tag. The magic cums in. You cannot select a part of text now in that td. Not jus in td tag. U can use it in span,div...... etc.

U can set the 'unselectable' attribute to either 'on' or 'off'. The default value for an unselectable attribute in an HTML element is set to 'off'.

Nice tip na...

k bye...

tezcols

Labels:

Wednesday, October 04, 2006

mmmmm JNLP..... whts tht.. ???

JNLP - Java Network Launching Protocol

What Is JNLP All About?

JNLP is an XML-based technology for launching Java executables over the Web. Just imagine that you could specify the classpath resources in your application (images, JAR files, properties, files, etc.), scattered over the Web and giving their URLs to run normal Java applications (Swing applications for example). This feature would give you the capability of deploying your GUI application on the web. Not just for applications online, this can be also be used for applications on your local system.

But there is a subtlety. Who will configure the JVM to launch your application this way? The most obvious answer is: another application—a kind of launcher, Java Web Start. This will prepare everything for the JVM to correctly execute your program. Remember that the JVM needs files copied locally on the client file system in order to use them.

The JNLP protocol consists basically of a set of rules that describe how this launching mechanism should be implemented. This can be done with a XML file.

A simple example of a JNLP xml is given below...

<jnlp spec="1.0+" codebase="http://www.xyz.com/apps" href="launch.jnlp">
<information>
<title>Hello JNLP</title>
<homepage href="http://www.tezcols.blogspot.com">
<vendor>Bitinbyte's</vendor>
<offline>
</offline>
<resources>
<j2se version="1.2+">
<jar href="bin/launch.jar">
</jar>
<application-desc>
</application-desc>
</j2se></resources>
</homepage>
</information>
</jnlp>

tezcols

Labels: