- 博客(253)
- 资源 (1)
- 收藏
- 关注
转载 How to call stored procedure in Hibernate
In this tutorial, you will learn how to call a store procedure in Hibernate.MySQL store procedureHere’s a MySQL store procedure, which accept a stock code parameter and return the related stock data.DE
2015-10-22 17:25:57
1101
转载 文章标题
In this tutorial, we will take the previous Spring MVC hello world XML-based, and convert it to a annotation-based project.Technologies used :Spring 2.5.6JDK 1.6Maven 3Eclipse 3.61. Directory Stru
2015-10-17 12:44:45
557
转载 Java Non-Blocking and Asynchronous IO with NIO & NIO.2 (JSR203) - Reactor/Proactor Implementations
Proactor/Reactor asynchronous IO patterns. I can see how by using selectable channels I can implement a Reactor style asynchronous IO mechanism quite easy (and have done so). But, I cannot see how I wo
2015-10-17 12:21:32
673
转载 How to Change the MySQL Timeout on a Server
A MySQL server timeout can occur for many reasons, but happens most often when a command is sent to MySQL over a closed connection. The connection could have been closed by the MySQL server because of
2015-10-16 13:52:22
657
转载 iBATIS - Hibernate
There are major differences between iBATIS and Hibernate. Both the solutions work well, given their specific domain. iBATIS is suggested in case −You want to create your own SQL’s and you are willing
2015-10-16 13:43:18
446
转载 MYSQL 8 Hours Time out Problem
I am using MYSQL 5.0 and Tomcat 5.5. After 8 hours , MYSQL closes by default all idle connections and so I am getting an SQL Exception .Any solution to this problemWhich connection pool are you using?
2015-10-16 13:17:18
710
转载 Java NIO 2.0 : Memory-Mapped Files | MappedByteBuffer Tutorial
If you know how java IO works at lower level, then you will be aware of buffer handling, memory paging and other such concepts. For conventional file I/O, in which user processes issue read() and write
2015-10-15 11:20:11
567
转载 Java NIO Files
The Java NIO Files class (java.nio.file.Files) provides several methods for manipulating files in the file system. This Java NIO Files tutorial will cover the most commonly used of these methods. The F
2015-10-15 10:03:40
735
转载 Java NIO AsynchronousFileChannel
In Java 7 the AsynchronousFileChannel was added to Java NIO. The AsynchronousFileChannel makes it possible to read data from, and write data to files asynchronously. This tutorial will explain how to u
2015-10-14 11:50:40
406
转载 RMI与RPC
分布式对象(Distributed Objects) 架构实例有CORBA/RMI/DCOM/.NET Remoting 远程过程调用(Remote Procedure Call) 架构实例有SOAP/XML-RPC/Flash AMF
2015-10-10 10:24:10
333
转载 java.io.RandomAccessFile
public class RandomAccessFile extends Object implements DataOutput, DataInput, CloseableInstances of this class support both reading and writing to a random access file. A random access file be
2015-10-09 14:06:18
379
转载 Reading and Writing using a Large Random Access File
I have a delimited file where each line is of a varying length and can have a varying amount of delimiters. I need to access a random line and replace it with a new line that may be shorter or longer i
2015-10-09 13:49:58
326
转载 Random Access Files
Random access files permit nonsequential, or random, access to a file’s contents. To access a file randomly, you open the file, seek a particular location, and read from or write to that file.This func
2015-10-09 13:33:50
442
转载 高性能I/O设计模式Reactor和Proactor
系统I/O可分为阻塞,非阻塞同步和非阻塞异步三类,非阻塞异步模式的扩展性和性能最好。 IO多路复用模式:Reactor和Proactor。 为Reactor和Proactor模式构建一个通用的,统一的对外接口并是一个完全可移植的开发框架选择方案:TProactor (ACE compatible Proactor) 。因为Linux对aio支持的不完整,所以ACE_Proactor框架在linu
2015-10-02 17:16:51
399
转载 Fast paging with MongoDB
Paging through your data is one of the most common operations with MongoDB. A typical scenario is the need to display your results in chunks in your UI. If you are batch processing your data it is also
2015-10-02 17:01:07
369
转载 Why NoSQL?
The Demands of Your Database are ChangingNoSQL technology was pioneered by leading internet companies — including Google, Facebook, Amazon, and LinkedIn — to overcome the limitations of 40-year-old rel
2015-10-01 14:42:22
695
转载 消息队列的使用场景是怎样的?
rebbitmq,activemq 跨系统的异步通信,所有需要异步交互的地方都可以使用消息队列。就像我们除了打电话(同步)以外,还需要发短信,发电子邮件(异步)的通讯方式。 多个应用之间的耦合,由于消息是平台无关和语言无关的,而且语义上也不再是函数调用,因此更适合作为多个应用之间的松耦合的接口。基于消息队列的耦合,不需要发送方和接收方同时在线。 在企业应用集成(EAI)中,文件传输,共
2015-09-30 13:50:57
2300
转载 ActiveMQ初体验
MQ(MessageQueue),消息队列,消息的接受和转发的容器,可用于消息推送。 ActiveMQ是Apache出品的一个开源的消息队列软件,运行在JVM下,支持多种语言,如JAVA,C++,C#。1、下载去官方网站下载:http://activemq.apache.org/ 我下载的是apache-activemq-5.8.0-bin 5.8版本,当然开源的也是支持下载source的,需要自
2015-09-30 13:45:30
315
转载 activemq的几种基本通信方式总结
简介activemq是JMS消息通信规范的一个实现。总的来说,消息规范里面定义最常见的几种消息通信模式主要有发布-订阅、点对点这两种。另外,通过结合这些模式的具体应用,我们在处理某些应用场景的时候也衍生出来了一种请求应答的模式。下面,我们针对这几种方式一一讨论一下。基础流程在讨论具体方式的时候,我们先看看使用activemq需要启动服务的主要过程。 按照JMS的规范,我们首先需要获得一个JMS c
2015-09-30 13:36:23
429
转载 ActiveMQ入门实例
1.下载ActiveMQ去官方网站下载:http://activemq.apache.org/2.运行ActiveMQ解压缩apache-activemq-5.5.1-bin.zip,然后双击apache-activemq-5.5.1\bin\activemq.bat运行ActiveMQ程序。启动ActiveMQ以后,登陆:http://localhost:8161/admin/,创建一个Queue
2015-09-30 09:51:18
287
转载 Java MongoDB : Save image example
In this tutorial, we show you how to use collection.remove() to delete documents from the collection.1. Test DataInsert 10 documents from number 1 to 10 for testing.for (int i=1; i <= 10; i++) { co
2015-09-29 22:19:04
414
转载 Spring MVC password example
In Spring MVC, you can use <form:password /> tag to render a HTML password field. For example,<form:password path="password" />It will renders following HTML code<input id="password" name="password" ty
2015-09-29 11:47:29
503
转载 Spring MVC textbox example
spring的便签带来了什么新功能? In Spring MVC, you can use <form:input /> tag to render a HTML textbox field. For example,<form:input path="userName" />It will renders following HTML code<input id="userName" name=
2015-09-29 11:36:35
326
转载 Java开发熟手该当心的11个错误
生产过程中出现的问题正逐渐得到中层和最高管理层的重视。不管是身为开发人员还是架构师,下列的事项都应该得到你足够的重视以避免陷入未来的尴尬境地。你也可以把它作为排查问题的便签。1、不在属性文件或XML文件外配置属性。比如,没有把批处理使用的线程数设置成可在属性文件中配置。你的批处理程序无论在DEV环境中,还是UAT(用户验收测试)环境中,都可以顺畅无阻地运行,但是一旦部署在PROD 上,把它作为多线程
2015-09-29 10:27:16
248
转载 用Java生成字符画
ASCII码艺术是一种技术,它利用ASCII标准中的可打印字符来产生视觉艺术效果。在历史上它有其存在的目的,当时的打印机还无法打印图片,并且当时在邮件中嵌入图像还无法实现,所以它也用于邮件中。本文中,我将为你呈现一个非常简单的ASCII码艺术产生器,它由Java语言编写,并可以配置字体和对比度。因为该产生器是我在周末用几个小时创建的,所以它还不完美,但却是一个有趣的实验。在下面你可以看到实现代码,并
2015-09-29 10:22:29
1701
转载 Python 3 TypeError: ‘str’ does not support the buffer interface
Review a Python 2 socket examplewhois.pyimport sysimport sockets = socket.socket(socket.AF_INET, socket.SOCK_STREAM)s.connect(("whois.arin.net", 43))s.send(sys.argv[1] + "\r\n")#Python 2.7 send sign
2015-09-29 10:16:54
1607
转载 Python – Check if key exists in dictionary
In Python, you can use the in operator to check if a key exists in a dictionary.test.pydef main(): fruits = { 'apple':1, 'orange':2, 'banana':3 } #if key 'apple' exis
2015-09-29 10:15:08
3076
转载 Python Whois client example
In this article, we will show you how to create a simple Whois client both in Python 2 and Python 3.TestedPython 2.7.10Python 3.4.31. Python 3 Whois exampleIn Python 3, the socket accepts bytes, so
2015-09-29 10:14:16
883
2
转载 Python 3 : Convert string to bytes
Code snippets to show you how to convert string to bytes and vice versa.1. To convert a string to bytes.data = "" #stringdata = "".encode() #bytesdata = b"" #bytesTo convert byte
2015-09-29 10:10:51
3703
转载 Python – How to delay few seconds
In Python, you can use time.sleep(seconds) to make the current executing Python program to sleep or delay a few seconds.import timetime.sleep(1) # delays for 1 secondstime.sleep(10) # delays for 10 se
2015-09-29 10:10:05
2544
1
转载 Java – Check if key exists in HashMap
In Java, you can use the Map.containsKey() method to check if a key exists in a Map.TestMap.javapackage com.mkyong.test;import java.util.HashMap;import java.util.Map;public class TestMap { public s
2015-09-29 10:05:20
956
转载 Java – Convert String to int
In Java, you can use Integer.parseInt() to convert a String to int.1. Integer.parseInt() ExamplesExample to convert a String “10” to an primitive int. String number = "10"; int result = Integer.
2015-09-29 10:03:24
1054
转载 Java – Display double in 2 decimal points
This article shows you a few examples to display a double variable in 2 decimal points format.1. DecimalFormat exampleTestDouble.javapackage com.mkyong.test;import java.text.DecimalFormat;public class
2015-09-29 10:01:07
462
转载 Java – Math.pow example
A simple Math.pow example, display 2 to the power of 8.In Math2^8 = 2x2x2x2x2x2x2x2 =256In JavaMath.pow(2, 8)Note In Java, the symbol ^ is a XOR operator, DON’T use this for the power calculation.Test
2015-09-29 09:49:36
820
转载 Java – How to split a string
To split a string, uses String.split(regex). Review the following examples : String phone = "012-3456789"; String[] output = phone.split("-"); System.out.println(output[0]); System.out.
2015-09-29 09:45:25
619
转载 Java – How to delay few seconds
In Java, you can use Thread.sleep(miliseconds) to make the current executing Java program to sleep or delay few seconds.TestSleep.javapackage com.mkyong.test;import java.util.Date;public class TestSlee
2015-09-29 09:33:11
361
转载 Python – How to loop a dictionary
In this tutorial, we will show you how to loop a dictionary in Python.1. for key in dict:1.1 To loop all the keys from a dictionary – for k in dict: for k in dict: print(k)1.2 To loop every
2015-09-29 09:31:04
1817
转载 Java MongoDB : Delete document
In this tutorial, we show you how to use collection.remove() to delete documents from the collection.1. Test DataInsert 10 documents from number 1 to 10 for testing.for (int i=1; i <= 10; i++) { co
2015-09-29 07:48:03
1079
转载 Java MongoDB : Update document
In this tutorial, we show you how to use Java MongoDB API collection.update() to update documents.Test DataAssume following data/documents are inserted.{ "hosting" : "hostA", "type" : "vps",
2015-09-29 07:36:47
819
转载 MongoDB hello world example
A quick guide to show you how to do basic operations like create, update, find, delete record and indexing in MongoDB. This example is using MongoDB 2.0.7, running on Mac OS X 10.8, both MongoDB client
2015-09-28 22:37:53
386
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人