Wednesday, June 22, 2011

Jboss 4: Change default port 8080

1. Goto the deploy folder of the server instance you use. (ie default):  C:\jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer

2. Find the file named server.xml inside that folder.

3. Look for the HTTP Connector section inside the server.xml where 8080 configuration is available. Change the port value to what ever the required port number:

<Connector port="8080" address="${jboss.bind.address}"   
         maxThreads="250" maxHttpHeaderSize="8192"
         emptySessionPath="true" protocol="HTTP/1.1"
         enableLookups="false" redirectPort="8443" acceptCount="100"
         connectionTimeout="20000" disableUploadTimeout="true" />

PD. This change wiill be available when JBoss is restarted.

Reference:
http://lkamal.blogspot.com/2006/09/jboss-4-how-to-change-port-8080-in.html

Friday, June 17, 2011

Editing rows in SQL Server Management Studio 2008

On your SQL Server Management Studio 2008, On your Tools menu, navigate as follows:

Tools -> Options... -> SQL Server Object Explorer -> Commands

You can change the Value for Edit <n> Rows command to any number you need. If you set 0, you will be able to edit all rows - so it will have functionality of Edit All Rows when using right click on the given table to edit table rows.

Source:
http://mkdot.net/blogs/hajan/archive/2010/08/31/editing-rows-in-sql-server-management-studio-2008.aspx

Wednesday, June 8, 2011

Jboss: Configure IP access

To configure the IP address of the server


run -b 192.168.1.1

If the server has multiple IP addresses and you want to access jboss from any of them:

run -b 0.0.0.0


Source:
http://www.mateamargonerds.com/programacion/42-lenguajejava/570-jboss-configurar-ip-de-acceso.html

Jboss: Configuring Connection to MS SQL Server 2005


1. Delete JBOSS_HOME/server/default/deploy/hsqldb-ds.xml

2. Copy JBOSS_HOME/docs/examples/jca/mssql-ds.xml to JBOSS_HOME/server/default/deploy.

3. In the new copy of mssql-ds.xml, I edit the connection-url, user-name and password elements to match my local SQL db instance:
from:
<jndi-name>MSSQLDS</jndi-name>
    <connection-url>jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=MyDatabase</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <user-name>x</user-name>
    <password>y</password>
to:
    <jndi-name>DefaultDS</jndi-name>
    <connection-url>jdbc:sqlserver://172.16.9.198:1433;DatabaseName=TESTDATABASE</connection-url>
    <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
    <user-name>testuser</user-name>
    <password>testpassword</password>

notice that jdbc:microsoft:sqlserver was changed to jdbc:sqlserver

4. Delete the file JBOSS_HOME/server/default/deploy/jms/hsqldb-jdbc2-service.xml.

5. Copied JBOSS_HOME/docs/examples/jms/mssql-jdbc2-service.xml into the folder JBOSS_HOME/server/default/deploy/jms

6. In the new copy of mssql-jdbc2-service.xml, replace the string MSSQLDS with DefaultDS:
from:
<depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=MSSQLDS</depends>

To:

<depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>

8. Copy the MSSQL JDBC driver sqljdbc.jar to JBOSS_HOME/server/default/lib.

Resources:

Friday, June 3, 2011

Eclipse on Windows : Invalid Configuration Location


"/../../../eclipse/configuration/org.eclipse.osgi. A common reason is that the file system or Runtime Environment does not support file locking for that location. Please choose a different location,or disable file locking passing "=Dosgi.lockling=none" as a VM argument. /../../../eclipse/configuration/org.eclipse.orgi/.manager/.fileTableLock (Permission denied)"

Solution
right click over "eclipse.exe" > "run as administrator"

Wednesday, June 1, 2011

MS SQL compare string CASE INSENSITIVE / SENSITIVE

-- case insensitive
SELECT UserId, email
FROM aspnet_membership
WHERE email = 'biilg@microsoft.com' COLLATE SQL_Latin1_General_CP1_CI_AS

-- case sensitive
SELECT UserId, email
FROM aspnet_membership
WHERE email = 'billg@microsoft.com' COLLATE SQL_Latin1_General_CP1_CS_AS

Source:
http://aspadvice.com/blogs/ssmith/archive/2007/09/30/Case-Sensitive-or-Insensitive-SQL-Query.aspx