- GORM Non numeric ID field
- Dependency Injection.
Stuff I think I should write down so I don't forget it....
Date startDate = new Date() -1;
Date endDate = new Date();
def Format = "yyyy-MM-dd"
def OFormat = "YYYY-MM-DD"
String startString = startDate.format(Format);
String endString = endDate.format(Format);
println "Running between $startString and $endString";
def sql = []
def sql1 ="""
select * from prov_auditing_master m where EVENTTIMECOMPLETED > to_date($startString,$OFormat) and EVENTTIMECOMPLETED < sql2 =""> to_date($startString,$OFormat) and EVENTTIMECOMPLETED < sql3 =""> to_date($startString,$OFormat)"+
" and EVENTTIMECOMPLETED < sql4 =""> to_date($startString,$OFormat) and EVENTTIMECOMPLETED < sql5 =" "> to_date($startString,$OFormat) and EVENTTIMECOMPLETED < sql6 = ""> to_date($startString,$OFormat)"+
" and EVENTTIMECOMPLETED < db =" int" i="1">
println i+": $sq"
i++
}
To fix
GString sql7 = "$sql6" ;
sql <<>
select top 10 * from people
//AlsoSET ROWCOUNT 10 // use
SET ROWCOUNT 0 to turn off
BEGIN
FOR cur_rec IN (SELECT object_name, object_type
FROM user_objects
WHERE object_type IN
('TABLE',
'VIEW',
'PACKAGE',
'PROCEDURE',
'FUNCTION',
'SEQUENCE'
))
LOOP
BEGIN
IF cur_rec.object_type = 'TABLE'
THEN
EXECUTE IMMEDIATE 'DROP '
|| cur_rec.object_type
|| ' "'
|| cur_rec.object_name
|| '" CASCADE CONSTRAINTS';
ELSE
EXECUTE IMMEDIATE 'DROP '
|| cur_rec.object_type
|| ' "'
|| cur_rec.object_name
|| '"';
END IF;
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ( 'FAILED: DROP '
|| cur_rec.object_type
|| ' "'
|| cur_rec.object_name
|| '"'
);
END;
END LOOP;
END;
/
// MySql
if not exists (select * from url where url = ...)
insert into url...
//Oracle (where not exists)
insert into <table> (<row1>, <row2>)
select <value1>, <value2> from dual
where not exists (
select * from <table> where <col1> = <value1>)
//SQL Server
if not exists (select * from url where url = ...)
insert into url...
Date Operations
GetDate
//MySql
DATE() see (http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html)
//Oracle
SYSDATE
// Sql Server
getDate()
To Date
//Oracle
to_date('2009-01-01','YYYY-MM-DD')
to_date('2009-05-19 18:32','YYYY-MM-DD HH24:MI')
http://www.dba-oracle.com/f_to_date.htm
Detecting Duplicates (group by criteria)
Say you want to detect duplicates (instances of more than one value) in a column. This is how to do it
select dupCol, count(dupCol) from table group by dupCol having count(dupCol)>1
Listing Constrainsts
Oracle
SELECT * FROM USER_CONSTRAINTS WHERE TABLE_NAME = 'myTable';
wsdl [-r rev] http://svnHost/repos/trunk/MyProject/myDir1/wsdl
list=$(find /apps/bea -print | grep .jar)
for el in $list; do
printf "Searching in %s\n" "$el";
case $el in
jar -tf $el | grep com.bea.console.utils.ConsoleRequestListener
;;
esac
done
<bean id="jaxb2Marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="com.company.package1:com.company.package2:com.company.package3:com.company.package4">
</property>
</bean>
<ns1:request ns1="http://www.company.com/Package1" ns2="http://www.company.com/Package2" ns3="http://www.company.com/Package3" ns4="http://www.company.com/Package4">
<ns1:data>text
</ns1:data>
</request>
<bean id="jaxb2Marshaller1" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="com.company.package1">
</property>
</bean>
<bean id="jaxb2Marshaller2" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
<property name="contextPath" value="com.company.package2">
</property>
</bean>
..etc..
Two things to check that might help: (I have not been able to test this now, as I no longer work on this project or for this client.)
* Make sure that you haven't somehow configured a foreign JNDI or foreign JMS server that is self referencing.
* Make sure that you haven't specified a URL when there's no need to specify a URL. (Server side applications and configuration should never specify a URL for a resource unless the resource is in a different cluster. When a resource is located in the same cluster, JNDI lookups should simply be made directly in the cluster's JNDI name-space. The way to ensure that the lookup is direct is simply to use initial contexts that were created without an URL.)
http://forums.oracle.com/forums/message.jspa?messageID=2675334#2675334
10:12:31 INFO [org.springframework.jms.listener.DefaultMessageListenerContainer
] - Successfully refreshed JMS Connection
10:12:31 DEBUG [org.springframework.jndi.JndiTemplate] - Looking up JNDI object
with name [java:comp/env/jms.queue.provisioning.request]
10:12:36 INFO [org.springframework.jms.listener.DefaultMessageListenerContainer
] - Setup of JMS message listener invoker failed - trying to recover
java.lang.StackOverflowError
at java.lang.String.indexOf(String.java:1564)
at java.lang.String.indexOf(String.java:1546)
at weblogic.jndi.internal.AbstractURLContext.removeURL(AbstractURLContext.java:24)
at weblogic.jndi.factories.java.javaURLContextFactory$JavaURLContext.rem
oveURL(javaURLContextFactory.java:130)
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
ava:130)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
ntextWrapper.java:45)
....
at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.j
ava:130)
at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyCo
ntextWrapper.java:45)
2008-07-26 00:14:08,679 DEBUG org.springframework.jms.listener.DefaultMessageListenerContainer - Consumer [weblogic.jms.client.WLConsumerImpl@14f7bad] of session [weblogic.jms.client.WLSessionImpl@15015db] did not receive a message
2008-07-26 00:14:08,696 INFO org.springframework.jms.listener.DefaultMessageListenerContainer - Setup of JMS message listener invoker failed - trying to recover
weblogic.jms.common.TransactionRolledBackException: Attempt to resume an inactive transaction: BEA1-11D22EBAEF18F82704CC:error resuming transacted session's internal transaction
at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSyncNoTran(DispatcherAdapter.java:61)
at weblogic.jms.client.JMSSession.receiveMessage(JMSSession.java:797)
at weblogic.jms.client.JMSConsumer.receive(JMSConsumer.java:579)
at weblogic.jms.client.WLConsumerImpl.receive(WLConsumerImpl.java:167)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(AbstractPollingMessageListenerContainer.java:404)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:285)
at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:874)
at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:259)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
Caused by: weblogic.jms.common.TransactionRolledBackException: Attempt to resume an inactive transaction: BEA1-11D22EBAEF18F82704CC:error resuming transacted session's internal transaction
at weblogic.jms.frontend.FESession.transactedException(FESession.java:2024)
at weblogic.jms.frontend.FESession.throwTransactedException(FESession.java:2039)
at weblogic.jms.frontend.FESession.transactedInfect(FESession.java:2140)
at weblogic.jms.frontend.FEConsumer.receive(FEConsumer.java:527)
at weblogic.jms.frontend.FEConsumer.invoke(FEConsumer.java:780)
at weblogic.messaging.dispatcher.Request.wrappedFiniteStateMachine(Request.java:759)
at weblogic.messaging.dispatcher.DispatcherServerRef.invoke(DispatcherServerRef.java:276)
at weblogic.messaging.dispatcher.DispatcherServerRef.handleRequest(DispatcherServerRef.java:141)
at weblogic.messaging.dispatcher.DispatcherServerRef.access$000(DispatcherServerRef.java:36)
at weblogic.messaging.dispatcher.DispatcherServerRef$2.run(DispatcherServerRef.java:113)
... 2 more
Caused by: javax.transaction.InvalidTransactionException: Attempt to resume an inactive transaction: BEA1-11D22EBAEF18F82704CC
at weblogic.transaction.internal.TransactionManagerImpl.resume(TransactionManagerImpl.java:360)
at weblogic.transaction.internal.ServerTransactionManagerImpl.resume(ServerTransactionManagerImpl.java:356)
at weblogic.jms.frontend.FESession.transactedInfect(FESession.java:2085)
... 9 more
2008-07-26 00:14:08,709 INFO org.springframework.jms.listener.DefaultMessageListenerContainer - Successfully refreshed JMS Connection
2008-07-26 00:14:08,713 DEBUG org.springframework.jndi.JndiTemplate - Looking up JNDI object with name [java:comp/env/meteor.jms.queue.provisioning.request]
2008-07-26 00:14:13,758 INFO org.springframework.jms.listener.DefaultMessageListenerContainer - Setup of JMS message listener invoker failed - trying to recover
java.lang.StackOverflowError
at java.lang.String.indexOf(Ljava.lang.String;I)I(Unknown Source)
at java.lang.String.indexOf(Ljava.lang.String;)I(Unknown Source)
at weblogic.jndi.internal.AbstractURLContext.removeURL(AbstractURLContext.java:24)
All
Set: **21*destination#[SEND]
Cancel: ##21#[SEND]
Query: *#21#[SEND]
No Answer
Delay nn seconds: max 30 seconds, in 5 second increments
Set: **61*destination*nn#[SEND]
Cancel: ##61#[SEND]
Query: *#61#[SEND]
Unreachable
Set: **62*destination#[SEND]
Cancel: #62#[SEND]
Query: *#62#[SEND]
Busy
Set: **67*destination#[SEND]
Cancel: ##67#[SEND]
Query: *#67#[SEND]
Cancel All
##002#[SEND]
All
Set: **21*destination*11#[SEND]
Cancel: ##21*11#[SEND]
Query: *#21*11#[SEND]
No Answer
Delay nn seconds: max 30 seconds, in 5 second increments
Set: **61*destination*11*nn#[SEND]
Cancel: ##61*11#[SEND]
Query: *#61*11#[SEND]
Unreachable
Set: **62*destination*11#[SEND]
Cancel: ##62*11#[SEND]
Query: *#62*11#[SEND]
Busy
Set: **67*destination*11#[SEND]
Cancel: ##67*11#[SEND]
Query: *#67*11#[SEND]
All
Set: **21*destination*25#[SEND]
Cancel: ##21*25 [SEND]
Query: *#21*25#[SEND]
No Answer
Delay nn seconds: max 30 seconds, in 5 second increments
Set: **61*destination*25*nn#[SEND]
Cancel: ##61*25#[SEND]
Query: *#61*25#[SEND]
Unreachable
Set: **62*destination*25#[SEND]
Cancel: ##62*25#[SEND]
Query: *#62*25#[SEND]
Busy
Set: **67*destination*25#[SEND]
Cancel: ##67*25#[SEND]
Query: *#67*25#[SEND]
All
Set: **21*destination*13#[SEND]
Cancel: ##21*13#[SEND]
Query: *#21*13#[SEND]
No Answer
Delay nn seconds: max 30 seconds, in 5 second increments
Set: **61*destination*13*nn#[SEND]
Cancel: #61*13#[SEND]
Query: *#61*13#[SEND]
Unreachable
Set: **62*destination*13#[SEND]
Cancel: #62*13#[SEND]
Query: *#62*13#[SEND]
Busy
Set: **67*destination*13#[SEND]
Cancel: ##67*13#[SEND]
Query: *#67*13#[SEND]
All
Set: **21*destination*89#[SEND]
Cancel: #21*89#[SEND]
Query: *#21*89#[SEND]
No Answer
Delay nn seconds: max 30 seconds, in 5 second increments
Set: **61*destination*89*nn#[SEND]
Cancel: ##61*89#[SEND]
Query: *#61*89#[SEND]
Unreachable
Set: **62*destination*89#[SEND]
Cancel: ##62*89#[SEND]
Query: *#62*89#[SEND]
Busy
Set: **67*destination*89#[SEND]
Cancel: ##67*89#[SEND]
Query: *#67*89#[SEND]
You use call barring to control what calls can be made or received by your account.
The barring code is specific to the network. Ask your service provider.
Note that Call Barring can't work if call diverts are active, even the autodivert set by the network.
All calls
Set: **330*barring code#[SEND]
Cancel: ##330*barring code#[SEND]
Query: *#330#[SEND]
Outgoing calls
Set: **333*barring code#[SEND]
Cancel: ##333*barring code#[SEND]
Query: *#333#[SEND]
Incoming calls
Set: **35*barring code#[SEND]
Cancel: ##35*barring code#[SEND]
Query: *#35#[SEND]
Outgoing international calls
Set: **331*barring code#[SEND]
Cancel: ##331*barring code#[SEND]
Query: *#331#[SEND]
Outgoing international calls except to home country
Set: **332*barring code#[SEND]
Cancel: ##332*barring code#[SEND]
Query: *#332#[SEND]
Incoming calls when outside home country
Set: *351*barring code#[SEND]
Cancel: #351*barring code#[SEND]
Query: *#351#[SEND]
Cancel All Call Barring
#330*barring code#[SEND]
There is no provision in the GSM specification for diverting SMS messages
Bar incoming SMS messages
Set: *35*barring code*16#[SEND]
Cancel: #35*barring code*16#[SEND]
Set: *43#[SEND]
Cancel: #43#[SEND]
Query: *#43#[SEND]
Reject: 0 [SEND]
Drop current call and answer: 1 [SEND]
Hold current call and answer: 2 [SEND]
Outgoing CLI Release (recipient sees your number)
Release: *31# destination [SEND]
Withhold: #31# destination [SEND]
Query default: *#31#[SEND]
Incoming CLI Presentation (you see the caller's number)
Allow: *30#[SEND]
Prevent: #30#[SEND]
Query default: *#30#[SEND]
Where nnn is the memory location number
nnn#[SEND]
Change Call Barring pin code
**03*oldpin*newpin*newpin#
Change SIM pin code
**04*oldpin*newpin*newpin#
Change SIM pin2 code
**042*oldpin*newpin*newpin#
Unblock SIM pin code
**05*PUK*newpin*newpin#
Unblock SIM pin code
**06*PUK2*newpin*newpin#
<build>
<!-- Replaced with build-helper-maven-plugin below to allow for multiple source directories
<sourceDirectory>${basedir}/src/main/java</sourceDirectory>
-->
<testSourceDirectory>
${basedir}/src/test/java
</testSourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
<debug>false</debug>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>
${basedir}/src/main/java
</source>
<source>
${basedir}/src/types/java
</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>jms.properties</value>
<ref bean="getNetworkServicePropertyFile" />
</list>
</property>
</bean>
<bean id="test" class="com.meteor.provisioning.Test">
<property name="jmsTemplate" value="${jms.receiveTimeout}" />
</bean>
public static BeanFactory getSpringContext() {
springConfigFile = System.getProperty("SpringConfig", springConfigFile);
if (_beanFactory == null) {
Resource resource = new ClassPathResource(springConfigFile);
//_beanFactory = new XmlBeanFactory(resource);
}
return _beanFactory;
}
public static Object getBean(String bean){
return getApplicationContext().getBean(bean);
}
and finally a test case
public class Test {
private String jmsTemplate;
public void setJmsTemplate(String jmsTemplate) {
this.jmsTemplate = jmsTemplate;
System.out.println("jmsTemplate = "+jmsTemplate);
}
@org.junit.Test
public void doTest(){
Utils.getBean("test");
}
}
Code | Result |
---|---|
*#7370# | Reset the phone N.B. This deletes all content off your SiM including Spiderman 3 activation code. Be sure to back it up before hand |
*#0000 | Show phone firmware version.. e.g. my N95 8GB (aka N95-2) is V20.0.016 02-03-08 RM-320 Nokia N95 (01.01) |
*#06# | IMEI number (International Mobile Equipment Identity) |
3 Finger Restart Call (Grenn Key) + * + 3. THen hold down start key | Does a hard restart. can be used if phone won't start. (Also try removing battery for about 10 seconds. This worked for me) |
*#92702689# | Life timer (W A R 0 A N T Y) - The amount of time your phone has spent sending and receiving calls. |
*#62209526# | Wireless MAC Address |
*#2820# | Bluetooth MAC address |
*#7370# | Format phone |