Alter column size mysql – ms sql

Posted on Leave a commentPosted in Uncategorized

Changing column size in both MySQL and MS SQL Server. When changing from wider to narrower size data might be truncated so be aware of that. MySQL ALTER TABLE workbook MODIFY NAME VARCHAR(255) ALTER TABLE workbook modify NAME varchar(255) MS SQL ALTER TABLE workbook ALTER COLUMN [NAME] VARCHAR(255) NULL GOALTER TABLE workbook ALTER COLUMN [NAME] […]

Manually firing Quartz scheduler jobs

Posted on Leave a commentPosted in Uncategorized

Exactly what the title says, this snippet will fire all job for all schedulers registered. // Get our scheduler factory StdSchedulerFactory schedulerFactory = new StdSchedulerFactory(); Collection<Scheduler> schedulers=schedulerFactory.getAllSchedulers(); for(Scheduler scheduler:schedulers){ System.out.println("scheduler "+scheduler.getSchedulerName()); String[] groups=scheduler.getJobGroupNames(); for(String jobGroup:groups){ System.out.println(" ** GROUP="+jobGroup); String[] jobNames=scheduler.getJobNames(jobGroup); for(String jobName:jobNames){ System.out.println(" ** jobName="+jobName); //Fire actuall job scheduler.triggerJob(jobName, jobGroup); } } }// Get our […]

Detect SQL server version

Posted on Leave a commentPosted in Uncategorized

Sometime we need to provide one script that works on multiple server, here is how to do in for SQL Servers 2000 and 2005. We will use simple technique to detect the server type using the serverproperty(‘ProductVersion’) for a list of options visit SERVERPROPERTY (Transact-SQL). So lets see what are the pros and cons of […]

Specifying java source and target version in Maven 2

Posted on Leave a commentPosted in Uncategorized

While converting from Ant to Maven2 i have came across following error while trying to compile the project generics are not supported in -source 1.4 (try -source 1.5 to enable generics) private Map variables; To fix the problem we need to add the pluggin configuration to our pom.xml <project> … <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> […]