Friday, December 21, 2001

another problem with custom tags and struts is that u can't easily insert a print statement to figure out what is going on.

Wednesday, December 12, 2001

it seems to be a good rule of thumb to either have the validate or input attribute on any action class. it was causing me problems??? null form parameter to perform?

Struts is crap. For instance you have to change the attribute class to styleClass. These little differences are virtually indistinguishable, and difficult to remember. Here is the html-struts reference.

Oracle's JDeveloper has hella support for struts... it has code insight and pallets for custom tags. but currently it's just a release candidate.

Tuesday, December 11, 2001

in struts, the input tag of the action attribute is where the page will revert if the form bean is null.

Tuesday, December 04, 2001

Dreamweaver UltraDev supports jsp 1.0, and really only supports model 1 JSP dev. There is a project in Jakarta, Taglibs, that makes tools for custom tags in dreamweaver ultra dev 4. It is sorta flaky and requires that you run tomcat.

Tuesday, November 27, 2001

Here is a struts config file gui (swing) tool http://www.jamesholmes.com/struts/console/
Here is a tool, ZipScan, that will search for a file in zip and jar files. http://download.cnet.com/downloads/0-10097-100-7936686.html

Monday, November 19, 2001

Stuts

STRUTS
Important note for the class org.apache.struts.action.Action:
Instance and static variables MUST NOT be used to store information related to the state of a particular request. They MAY be used to share global resources across requests for the same action.

Problems with the java plugin running in IE 5.5 on Win 2k sp2 not working.
1) remove CLASSPATH
2) remove all other VMs from the PATH
3) make sure JIT is checked in plugin control panel.

when the plugin is working u should get a duke icon in the system tray. you can double click the icon for the console.

\lib\security\java.policy - this file, in the jre, is used to give the plugin permissions. it's an alternative to signing the applet.
Here is an example of stuff you can add in the grant block:
permission java.io.FilePermission "C:/WINNT/SYSTEM32/ipconfig.exe", "execute";
permission java.lang.RuntimePermission "queuePrintJob";

Friday, November 16, 2001

Be sure to add -classic as a VM parameter when debugging in JBuilder. It really speeds the debugger up.

Use these tags to keep an html page from being cached. JACK SAYS THIS DOESN'T WORK!!!
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">

be sure to use the /**@todo */ tag for incomplete work in java. JBuilder has a listing on the side of all todo items for a file.

Thursday, November 15, 2001

Here is how to debug orion/oc4j in JBuilder (even with Foundation): http://www.orionsupport.com/articles/jbuilder-debugging.html

In IE to get more information than "500 Internal server error" disable "friendly error messages". This is done under Internet-options -> advanced and will show you the real error message.

Oracle FAQCan I view the Servlet code generated from a JSP after translation?
Yes. To do this, specify the "development=true" attribute in the global-web-application.xml configuration file. The generated servlet code will be saved in the persitstence directory for your application. The persistence directory can be found in the $ORACLE_J2EE_HOME/application-deployments/application directory, where application is the name of the application you are using.

Currently still unsure exactly how to debug jsp.

Wednesday, November 14, 2001

When creating 3d UI controls the "light source" usually emanates from the left top of the computer screen

In order to customize the icon in the address bar, and favorites menu for IE 5 create a 16 by 16 pixel icon, name it favicon.ico and save it to the root directory. More details at favicon.com

If you want to use an ActiveX or COM object in a Java Program try using Neva Object. If you want to wrap a JavaBean to be used as an ActiveX component use the Java Plugin.

Tuesday, November 06, 2001

Problems with current project: The defect tracking is not integrated with the source control. We are using Ant and JBuilder and they really should be integrated. I prefer using JBuilder for the build and scripts for copying other files. We don't even have a debugger. We are using oc4j which is not integrated into the ide, and doesn't support jsp very well.

i've been using ant, and it quit working. I went through and manually deployed my files through windows and i realized jbuilder had locked one of my files. ant should have reported that problem to me. i have spent an embarassing amount of time trying to figure that out. ant stinks.

current project is using ant for deploy and jbuilder for ide. problems include long build times because ant is configured to rebuild everytime. also it causes problems with not saving. if you were using jbuilder for build it would automatically save all files before a build.

Monday, November 05, 2001

oc4j has hot deploy but it doesn't detect when you only change a jsp file. it does detect changed class files. but you can use the console to make jsp changes without redeploying at all.

Tuesday, September 18, 2001

SQL Reference

sql reference
standards: sql92 and sql99, sql 2003

use single quotes for string literals.
(use '' for literal single quote)
double quotes in sql92 are used around identifiers
(identifiers examples are table and field names)
sql server uses [] around identifiers
boolean literals: TRUE, FALSE, NULL (no quotes)
date literals: `31-JAN-94' (oracle)
date literals: '2004-10-12' (mysql)
date literals: '10/12/2004' (mysql)

use -- for comments (sql 92)
/* */ (non-standard? works in t-sql)

not equal
<> - standard, oracle, sql server
!= - non-standard, oracle, sql server
^= - non-standard, oracle

equal
= (not == like in code)

data manipulation:

select, insert, update, delete
-to query recods
select (* or fields) from (table-name) [as alias]
[where (condition)]
[order by (columns) [ASC | DESC]]
[group by (columns)]

asc goes up. (the default)
1
2
3

desc goes down
3
2
1

-to add data to a table
insert into (table-name) values(value, value2,...)
insert into (table-name) (column1, column2, ...) values(value, value2,...)

- update a record
update (table-name) set (column-name)=(value) [where (condition)]

- to remove a record
delete from (table-name) [where (condition)]

data definition:

create, drop, alter
multi database ddl example generator:

- create a table
create table (table-name) ((column-name) data_type)

- To change the fields in a table.
alter table (table-name) [add drop modify] ((column-name) data_type);

- drop a table
drop table (table-name)

- To add an index (not a sql standard?)
create index (index_name) on (table_name) (columns);

****
Constraint clause
This clause is part of the create or alter table commands. The format is:
CONSTRAINT constraintname the constraint specifications

The following are some typical constraint specifications:

**oracle?
PRIMARY KEY--Attribute is unique, not null and indexed
UNIQUE--Attribute is unique and indexed but not the key
NOT NULL--Attrbute value cannot be left blank
REFERENCES--Foreign key constraint. The attribute must match a value of a specified attribute

**sql server?
(1) Primary Key,
(2) Foreign Key,
(3) Unique Constraint,
(4) Default Constraint and
(5) Check Constraint (sql server used to have a rule constraint)

1 PRIMARY KEY
2 UNIQUE
3 FOREIGN KEY
4 CHECK
5 NOT NULL


**********JOINS:
CROSS JOIN - never used.
INNER JOIN - exclusive
OUTER JOIN - inclusive
SELF JOIN - ?

3 types of outer joins: (mysql syntax)

LEFT OUTER JOIN (*=)
RIGHT OUTER JOIN (=*)
FULL OUTER JOIN

right outer join means column on right side of equals doesn't have to exist and the record will still show up.

LEFT OUTER JOIN rateplans ON rateplans.ID = transactions.RatePlan

***** UNIONS

*** data control language (DCL)
grant
revoke

********SQL************
(Informix)
- To see stuff about the table (doesn't work on sql server)
info status for (table_name)

- To unload a table
unload to "(path-name)" select ...

- To load a table
load from (file_name).unl insert into (table_name);

***************************
Database Compatiblity Issues

article on converting from mysql to oracle.

type mappings from sql server to oracle

different date formats
different blob formats
different reserve words and variable name lengths
different name spaces. (sql server server.db.owner.table)
(mysql server.db.table)
different syntax and support for transactions, stored procedures, triggers, etc.

different methods for automatically creating unique keys
mySql has AUTO_INCREMENT
access has auto number
sql server has Identity columns.
Oracle has sequences. (also has OID)

different methods for getting the automatically generated unique key
sql server(sql) - SCOPE_IDENTITY()
mysql/php - mysql_insert_id()

*programatically you can create a universal unique id.
this will allow you to merge databases. (like april)
is this functionality available in sql server or oracle(OID)?

*********** First 10 records

MySQL and PostgreSQL: select * from table limit 10
Microsoft SQL Server and Access: select top 10 * from table
Oracle 8i: select * from (select * from table) where rownum <= 10 oracle ?: SELECT * FROM Employees where rownum <= 10 DB2: select * from table fetch first 10 rows only Informix: select first 10 * from table ***** RANGES mysql: select * from table LIMIT 0 , 30 sql server: SELECT TOP 30 * FROM table (to get a range: in memory table w/ primary key) use key to get range insert into in memory table fed from select this gets rows 300-400 SELECT * FROM ( SELECT TOP 100 * FROM (SELECT TOP 400 * FROM MyTableSrt ORDER BY SortCol) a1 ORDER BY SortCol DESC ) a2 ORDER BY SortCol db2/400: (ibm ref)
SELECT * FROM SISSHLD250.CINMEX96 where NEAGT6LVL='" + TextBox2.Text + "' fetch first 10 rows only



*************************** subselect example:
INSERT INTO PTFCOMFD/CIUSRF SELECT 'THOMAAX', UFMODU, UFFUNC,
UFEFCN, UFEFYY, UFEFMM, UFEFDD, UFEXCN, UFEXYY, UFEXMM, UFEXDD FROM
ciusrf WHERE UFUSID='ATWOOTX' and UFMODU='IBS' and UFFUNC='CCP'


***************************
Types:
BLOB - Binary large object
CLOB - Character Large object


***************************Transactions:
ACID (atomicity, consistency, isolation, and durability).

atomic - all together
consistency - rules may be broken during transaction
(account may be negative, but in end it is consistent)
isolation - locks the data. solves concurrency issues.
durability - survives failures (creates transaction log)

nested transactions allows nested beds of atomic transactions.
example trip

**** mysql (?)
BEGIN WORK (or START TRANSACTION)
COMMIT
ROLLBACK

*** sql server
BEGIN TRAN [transaction name]
COMMIT TRAN
ROLLBACK TRAN
SAVE TRAN

********************** built-in libraries
getdate() - get current datetime (sql server)
now() - get current datetime (mysql)


******************** system tables:

SQL Server system tables (tables start with sys)
IBM system catalog
Oracle data dictionary