jump to navigation

Negate find July 22, 2006

Posted by maxmil in : Debian , add a comment

In order to search for files that don’t match a certain pattern…

find . -not -name "myfilename"

ps/2 mouse in the 2.6 kernel July 20, 2006

Posted by maxmil in : Debian , add a comment

My usb mouse just died and i plugged in a ps/2 mouse that i had spare. When i rebooted xserver failed to start.

In my 2.6 kernel the necessary mouse modules were not being loaded. I addedpsmouse
mousedev

in that order to /etc/modules.

Now everything works AOK.

Changing between multiple jdk’s

Posted by maxmil in : Debian, Java , add a comment

To use a different jdk when you have several installed.

As root

update-alternatives --config java

Adding css styles to file uploads

Posted by maxmil in : css , add a comment

http://www.quirksmode.org/dom/inputfile.html

http://www.michaelmcgrady.com/file_browse_images.jsp

Imp dump to different table space July 13, 2006

Posted by maxmil in : Oracle , add a comment

Having problem importing a dumped schema into a new table space. This looks like the answer…

http://www.experts-exchange.com/Databases/Oracle/Q_20963033.html

Building J2EE projects with Maven July 12, 2006

Posted by maxmil in : Java, Maven , add a comment

Good article…

http://www.onjava.com/pub/a/onjava/2005/09/07/maven.html?page=1

Order by ascii in Oracle July 11, 2006

Posted by maxmil in : Oracle , add a comment

I needed to order a table num-alpha instead of alpha-num which is the Oracle default ordering. By num-alpha i just mean numbers before letters, for example 0,1,2,3,4,5,6,7,8,9,a,b,c,d…

My first intent was to use Oracles ascii function:

select idproducto from productos order by ASCII(idproducto);

However this returns a value based only on the first character of idproducto, in this way aa and az return the same value, so that was no good.

The solution that i have found is to do a binary sort using the NSLSORT function:

select idproducto from productos order by NLSSORT(idproducto, 'NLS_SORT=BINARY');

Voila!

Instalation Websphere 5.0 July 7, 2006

Posted by maxmil in : websphere , add a comment

http://publib.boulder.ibm.com/infocenter/wasinfo/v5r0/index.jsp?topic=/com.ibm.websphere.base.doc/info/aes/ae/tins_epinst.html

JNDI Oracle and Tomcat 5 July 5, 2006

Posted by maxmil in : Java, Oracle, tomcat , add a comment

Been having problems setting up a JNDI oracle datasource in tomcat 5. With apaches common-dbcp i was able to use the getConnection() method of java.sql.Datasource but the getConnection(String username, String password) method ALWAYS returns a java.lang.UnsupportedOperationException.

From what i have seen on the web this is a limitation of the apache common connection pool. However for Oracle there is another factory that is bundled within classes12.jar that you can use. I found the solution here…. http://www.microdeveloper.com/html/JNDI_Orcl_Tomcat.html

Basically its just a question of specifying the type of the datasource as oracle.jdbc.pool.OracleDataSource and the connection pool factory as oracle.jdbc.pool.OracleDataSourceFactory.

This is my context.xml

<?xml version='1.0' encoding='utf-8'?>
<Context docBase="E:/work/proj/vaesa-st/bo/webroot" path="/soporte-tecnico/backoffice" reloadable="true" debug="1">
<Resource name="jdbc/SoporteTecnico_DataSource" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"/>
<ResourceParams name="jdbc/SoporteTecnico_DataSource">
<parameter>
<name>factory</name>
<value>oracle.jdbc.pool.OracleDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@193.106.32.211:1521:VAESA</value>
</parameter>
<parameter>
<name>maxActive</name>
<value>20</value>
</parameter>
<parameter>
<name>username</name>
<value>soportetecnico</value>
</parameter>
<parameter>
<name>password</name>
<value>vaesa</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>
</Context>

and from my web.xml

<resource-ref>
<description>Soporte Tecnico datasource</description>
<res-ref-name>jdbc/SoporteTecnico_DataSource</res-ref-name>
<res-type>oracle.jdbc.pool.OracleDataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>

and the code connection snippet

Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/SoporteTecnico_DataSource");
conn = ds.getConnection("xxx", "xxx");

Set serveroutput on in sqlplus July 4, 2006

Posted by maxmil in : Oracle , add a comment

in sql plus or sql worksheet to use commands like dbms_output.put_line to write output you first need to issue a SET SERVEROUTPUT ON