- 浏览: 25559 次
- 性别:
文章列表
1.创建app
选中项目名右击---django---create application 输入名称product
2.修改settings.py
在installed_apps中添加product
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'djang ...
input输入框错误提示信息
- 博客分类:
- 前段 css
图形验证码:
<script src="jquery-1.9.1.js"></script>
<script src="inputTip.js"></script>
<style>
.item_mini {
margin-top:10rem;
}
</style>
<script type="text/javascript">
function tipInput(element,flag,message) { ...
1.调用代码
import ch.ethz.ssh2.*;
import java.io.*;
import java.nio.charset.Charset;
import java.text.SimpleDateFormat;
import java.util.Date;
public class RemotShellTool {
public static void main(String[] args) throws Exception {
// 上传文件
RemotShellTool.updateFile(); ...
import java.util.concurrent.*;
public class FutureTaskTest {
public static void main(String[] args) {
// 线程1
Callable<String> tempCall1 = new Callable<String>(){
@Override
public String call() throws Exception {
Thr ...
1.pom.xml
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>j ...
1.java代码
public static void callProducre() throws Exception {
Connection conn = getConn();
String sql = "{call exportExcle(?,?,?,?)}";
CallableStatement statement = conn.prepareCall(sql);
// 设置输入参数
statement.setLong(1, 1);
statement.setLong(2, 1000);
// 设置输出参数
sta ...
1.jdbc批量导入数据 大约3秒导入32万条记录
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;
public class HttpXmlSender_export_data {
public static void main(String[] args) throws Exception {
List<St ...
CREATE FUNCTION `months_between`(`big_date` date,`small_date` date) RETURNS int(11)
BEGIN
declare diffMonth int;
declare diffYear int;
declare diffDay int;
declare number int;
select month(big_date)-month(small_date) ,day(big_date)-day(small_date) ,year(big_date)-year(small_dat ...
1、client客户端
public class Client {
/**
* 处理服务端发回的对象,可实现该接口。
*/
public static interface ObjectAction{
void doAction(Object obj,Client client);
}
public static final class DefaultObjectAction implements ObjectAction{
public void doAction(Object obj,Client client) {
System. ...
1、RpcService,把本地的服务暴露给ZooKeeper
@Component("rpcService")
public class RpcService implements ApplicationContextAware,InitializingBean {
private String serviceAddress;
private Map<String,Object> handlerMap;
private ZookeeperRegister zk;
public RpcService(String servic ...
闲暇时研究了下基于ZooKeeper实现的分布式事务锁,做下记录,便于回顾复习
public class DistributeLock implements Lock,Watcher {
//锁的名称
private String lockName;
private long TIMEOUT = 3000;
//当前锁的节点
private String currentLockNode;
//前一个锁的节点
private String prevLockNode;
private ZooKeeper zk;
private int SESSION_TI ...
最近在看java nio,模仿别人写了一个,用于学习研究下。没有操作页面,每个客户端另起一个线程来接收消息,client3发送消息时,其他的客户端都能接收到消息
1、服务端
public class ChatService {
private Selector selector;
private Charset charset = Charset.forName("UTF-8");
private SelectionKey service = null;
private boolean ISRUN = true;
public ChatSe ...
1、存储过程
create or replace procedure logBigDataTrasfor
is
queryEndDate Date:=to_date(to_char(sysdate - interval '3' month,'yyyy-MM-dd'),'yyyy-MM-dd');
queryStartDate Date:=to_date(to_char(sysdate - interval '6' month,'yyyy-MM-dd'),'yyyy-MM-dd');
idLog CSSP_USER_ACCESS_LOG_V2.ID_LOG%type;
...
注:查询传参时,日期参数to_date要加‘’(引号)
create or replace procedure logBigDataTrasfor
is
queryEndDate Date:=to_date(to_char(sysdate - interval '3' month,'yyyy-MM-dd'),'yyyy-MM-dd');
queryStartDate Date:=to_date(to_char(sysdate - interval '6' month,'yyyy-MM-dd'),'yyyy-MM-dd');
idLog CSSP_USER_ACCESS ...
1、比较类
package com.test.classreflection;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
/**
* 比较类
* @author LIUHE524
*
*/
public class ClassAttrValCompare {
private DifferenceAttr differenceAttr;
public ClassAttrValCompare() {
differen ...