Archive for November, 2004
Overflow in Wp-Dstats2 Wordpress plugin?
Nov 30th
There seems to be a problem in the PHP code of the Wp-Dstats2 statistics plug-in for Wordpress. The problem occurs when your number of unique visitors (unique IPs) grows large, typically somewhat less that 30.000.
Read the rest of this entry »
Toplink’s Object to XML mapping
Nov 25th
On OTN there is an excellent online seminar (replay) on the TopLink Object-to-XML support.
This feature, which will be available in the upcoming 10.1.3 release, allows converting XML files into Java objects and vice versa. For those allready working with TopLink’s Object-relational mapping, the following will sound very familiar.
It is built on the JAX-B 1.0 specification. This is one one way of using the TopLink workbench, based on an XML schema the workbench can generate Java Classes using its built-in JAX-B compiler. Toplink also generates mapping metadata. These metadata provide a definition of how a certain XML element corresponds to a certain Java element. In this way a buffering layer is created between your object model and the XML-schema. Changes in a XML schema don’t not have to lead to changes in your object model. The changes will be done in the mapping metadata.
This also means you can connect your existing object model to an XML schema . Just import the classes into the mapping workbench, specify the schema and make the mappings. You can also specify transformation rules, for example in your XML-schema gender is represented as F and M , but in Java you want it to be Female and male.
In your application the TopLink runtime will use the metadata to marshall and unmarshall you XML documents.
There is a lot of extra info (and a Developer preview) on the TopLink product page on OTN
A nice sideline question is whether JDevelopers ADF will have out of the box support for O-X Toplink projects
Tom Kyte presenting in The Netherlands – 8,9 and 10 February
Nov 25th
On February 8, 9 and 10, Tom Kyte will present a seminar – just around the corner, in Utrecht. See Seminar Details for details. The event is organized by fellow Oak Table member Lex de Haan (you may know him from the HR schema in the Oracle database -
select * from hr.employees where emp_id = 102
-. It is a rare opportunity to see Tom Kyte in action on this side of the Atlantic or at least in The Netherlands.
From his column in Oracle Magazine, is own website asktom and especially his two books – Expert One-on-One Oracle and Effective Oracle by Design, both of which we use extensively for our Oracle 7Up (…to10g) workshops – I can only highly recommend this seminar for any (senior) Oracle Developer. AMIS will most certainly attend with a bunch of people!
He will speak about: Read the rest of this entry »
WSRF: modeling state with Web Services
Nov 24th
In the whitepaper titled Modeling Stateful Resources with Web Services by Ian Foster et. al. the latest developments with respect the modeling of state with web services are very clearly introduced and discussed. Together with Karl Kesselman, Ian Foster is considered to be one of the founding fathers of Grid computing.
Since I have been actively involved in Grid computing, I witnessed the emergence of the WS-Resource Framework (WSRF) as a kind of spin-off from the research of the Global Grid Forum’s Open Grid Services Infrastructure (OGSI) Working Group. Although my current activities don’t involve these latest developements, I’m trying to keep myself somewhat up-to-date. These kind of papers are exactly serving this purpose.
It does not only address the latest developments, but also presents a clear description/explanation (+ taxonomy) of the way in which state and WSs are related, hence a recommendation for those who are interested to be informed on the latest developments in “web service land” and want to learn about how the world of Web Services meets the Grid.
Deploy an Oracle JHeadstart/BC4J application to IBM WebSphere
Nov 24th
If you’ve created a J2EE JHeadstart/BC4J application and you want to deploy it to the Oracle Application Server, it works easily. If you want to deploy it to IBM WebSphere, it will also work fine if you take care of the following:
1. Make sure you have all the necessary BC4J libraries available:
Visit http://www.oracle.com/technology/products/jdev/howtos/appservers/deploy_bc4j_to_websphere.html for a list of all the files you need. Add the jar-files to the WEB-INF\lib directory of your application.
2. Enable Log4J logging
IBM has implemented commons-logging for WebSphere 5.1, which is leading. JHeadstart works with log4j. You can enable the log4j logging by doing the following:
3. Change the default XML parser
Oracle uses the Oracle XML parser as default, but IBM uses Xerces. Add the Oracle XML parser to the WEB-INF\lib directory of your application and if present, remove the xerces parser (also when you need the xerces parser in your application!). Now the Oracle XML parser will be used as default and since WebSphere also contains the xerces parser itself, it can still be used when necessary.
This solutions was found with help of Meindert Deen from Xebia.
SchemaSurf (Freeware) – Browser based tool to navigate the database
Nov 23rd
Perhaps SchemaSurf from Cobblesoft – FREEWARE – is worth a little investigation.
SchemaSurfTM is a browser-based tool for querying your Oracle database schemas. Unlike most other tools, SchemaSurf does not rely upon SQL*Net and, therefore, can be accessed from anywhere in the world. In addition to providing quick and easy database access from the office, SchemaSurf is the perfect companion for telecommuters, developers and support personnel working from home.
Developing applications in today’s rapidly changing business environments requires fast, easy, yet secure access to underlying schemas. SchemaSurf allows users to browse objects, view definitions, pull existing data (to both screen and spreadsheet), and extract by copy PL/SQL program units.
By design, SchemaSurf is a query-only tool, allowing DBAs and IT managers to rest assured in the knowledge that their developers are not updating “on-the-fly” in production. SchemaSurf overcomes many corporate security and change control issues prevalent in other tools, where actions can be performed against any database for which a user has SQL*Net access and a valid login.
SchemaSurf also provides a portal to primary Oracle-related web sites, user group information, developers documentation, and other interest areas via a non-intrusive sponsorship area. The portal reflects CobbleSoft’s goals of enhancing the learning and sharing process to promote successful enterprise using Oracle technology.
Technology: It is essentially WEB PL/SQL and requires Oracle HttpServer with MOD_PLSQL – it can be compared I suppose with the Repository Object Browser which offers similar functionality for the Oracle SCM and Designer Repository.
Certification:
Database Version: Oracle 8.1.7 and 9i Rel 1 & 2
Web Server: 9iAS (Rel 1, 2, Java Edition), Oracle HTTP Server, OAS4.0.8, Apache and mod_pl/sql
Client Browser: Internet Explorer 5.1+ and Netscape 6.2+ (JavaScript required)

Quick and easy SSL in OC4J Standalone
Nov 21st
During development it is sometimes necessary to able to run your webapplication under SSL. To obtain a test certificate from verisign can sometimes take a little too much time and effort. Especially when there is a bug waiting to be fixed.
This post describes an easy way to create a certificate yourself using SUN’s keytool and configure OC4J to use it. It originates almost one to one from the Oracle Application Server Containers for J2ee Stand Alone User’s Guide (how about that for a title).
I assume that you have at least JDK 1.3 installed and setup correctly. Make sure that the you set the PATH to include the JDK’s bin directory.
Making up records in SQL Queries – Table Functions and 10g Model clause
Nov 21st
From time to time there is a need in my SQL queries to have access to a table with a specific number of records. Sometimes I want to explode the results from a query – double, treble etc. the number of records. On other occasions I want to select from a specific range or outer join with a specified range to have an entry for every rank, date etc. More concrete examples (in terms of EMP and DEPT):
- select the number of employees hired on every day of the week – include entries for days on which no one was hired
- select the employees ranked on even positions when ordered by salary (note: there are many ways to approach this)
- present for the numbers 1 to 5 the number of employees that manage that number of subordinates
- select all employees as many times as there are Clerks
Of course the old way of doing this was create a utility or helper table that contained a very large number of records (something like dual but with many rows). Each row typically only contained a number. At other times you also have created tables with seven records (days of the week), twelve records (months of the year), 26 records (letters in the alphabet) etc. However, these could all have been derived in views from the one table with just many numeric values. You could also fake this table by using a view or table in your schema that you know to be always available and contain a substantial number of records. Tom Kyte’s favorite for example is ALL_OBJECTS. We will look at the ‘modern’ way: TABLE FUNCTIONS (Oracle 9i) and the MODEL clause (10g). Read the rest of this entry »
ADF BC classes & methods overview
Nov 19th
Steve Muench wrote up a superb overview of the most commonly used classes, interfaces & their methods in the ADF BC framework (formerly known as BC4J). You might want to check this out as it leads you straight to the stuff you need to write your apps, without getting lost in the JavaDoc…
Setting up Oracle JNDI Datasource on Tomcat
Nov 19th
In one of the projects I’m involved in we have to make use of specific Oracle JDBC features. The application runs on Tomcat 5.0.27 and connects to the database using a JNDI datasource setup to use connection pooling . When setting this up based on info I found in Steve Muench ’sBC4J Toy Story example I ran into some problems .
For some reason I got the following error:
“java.sql.SQLException: User credentials doesn’t match the existing ones”.
It really drove me nuts. Checking parameternames over and over, checking username and password … But together with Martijn Hinten of Cumquat I managed to track down the problem. This error only occurs if you specify the minLimit parameter, used to specify the minimum number of pooled connections the pool should have. If you ommit it everythings fine .. This is the minimum context file we needed to get the OracleConnectionCacheImpl working
<?xml version='1.0' encoding='utf-8'?>
<Context displayName="udo" docBase="C:/development/appservers/jakarta-tomcat-5.0.27/webapps/myContext" path="/myContext" workDir="workCatalinalocalhostmyContext">
<Resource name="jdbc/myDataSource" type="oracle.jdbc.pool.OracleConnectionCacheImpl"/>
<ResourceParams name="jdbc/myDataSource">
<parameter>
<name>factory</name>
<value>oracle.jdbc.pool.OracleDataSourceFactory</value>
</parameter>
<parameter>
<name>password</name>
<value>****</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:oracle:thin:@localhost:1521:***</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>oracle.jdbc.driver.OracleDriver</value>
</parameter>
<parameter>
<name>user</name>
<value>local_user</value>
</parameter>
</ResourceParams>
</Context>
Place this file under the name myContext.xml in tomcat_home/conf/Catalina/localhost. Now you should be able to use this Datasource from within the “myContext” web -application using the following code
InitialContext context = new InitialContext();
envContext = (Context) context.lookup("java:comp/env");
ds = (DataSource) envContext.lookup("jdbc/myDataSource");


