Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)| /* | |
| * Copyright (C) 2011 João Xavier | |
| * | |
| * Licensed under the Apache License, Version 2.0 (the "License"); | |
| * you may not use this file except in compliance with the License. | |
| * You may obtain a copy of the License at | |
| * | |
| * http://www.apache.org/licenses/LICENSE-2.0 | |
| * | |
| * Unless required by applicable law or agreed to in writing, software |
| package com.vaughandroid.test.espresso.idlingresources; | |
| import android.app.Activity; | |
| import android.os.Handler; | |
| import android.support.annotation.IdRes; | |
| import android.support.annotation.NonNull; | |
| import android.support.test.espresso.*; | |
| import android.view.View; | |
| import java.lang.ref.WeakReference; |
Look at LSB init scripts for more information.
Copy to /etc/init.d:
# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)I hereby claim:
To claim this, I am signing this object:
| // create a java calendar instance | |
| Calendar calendar = Calendar.getInstance(); | |
| // get a java date (java.util.Date) from the Calendar instance. | |
| // this java date will represent the current date, or "now". | |
| java.util.Date currentDate = calendar.getTime(); | |
| // now, create a java.sql.Date from the java.util.Date | |
| java.sql.Date date = new java.sql.Date(currentDate.getTime()); |
| CallableStatement cstmt = conn.prepareCall( | |
| "{call StoredProcedureName ( [Parameter Definition] ) }" | |
| ) | |
| Types of parameters allowed include: | |
| 1) Input(Default) | |
| 2) Output | |
| 3) Input Output | |
| To Set the Parameters we use: |
| DELIMITER // | |
| DROP PROCEDURE IF EXISTS addnewemployee // | |
| CREATE PROCEDURE addnewemployee | |
| ( | |
| IN eno int(11), | |
| IN ebdate date, | |
| IN efname varchar(14), | |
| IN elname varchar(16), | |
| IN egender enum('M', 'F'), | |
| IN ehdate date |
| public class Person { | |
| private final Object key = new Object(); | |
| public String init() { | |
| synchronized(key) { | |
| // Do stuff | |
| } | |
| } | |
| } |