Use of calender:Package Test;import Java.text.parseexception;import Java.text.simpledateformat;import java.util.ArrayList;import Java.util.calendar;import Java.util.list;public class Test {public static void main (string[] args) throws ParseException {listThank you for your support and love I will continue to refuel! ~Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. JAVA Calender Use implement
", "Learning map with put value");Map.put ("2", "Learning Map Traversal method");Map.put ("3", "Hello World");The first traversal method is commonly used by Map.get (key) two timesFor (String Key:map.keySet ()) {System.out.println ("Key" +key+ "value" +map.get (key));}The second traversal method uses iterator to traverse key and value through Map.entryset: (iterator traversal)Iteratorwhile (It.hasnext ()) {map.entrySystem.out.println ("Key" +entry.getkey () + "value" +entry.getvalue ());}The thi
errormsg varchar (1000);
Empcur Sys_refcursor;
EMP Scott.emp%rowtype;
Begin
Searchempbydept (10,empcur, errormsg);
If errormsg is not null then
dbms_output.put_line (errormsg);
End If;
Loop
fetch empcur into EMP;
EXIT when Empcur%notfound;
Dbms_output.put_line (emp.ename);
End Loop;
Close empcur;
End
Java calling code:
public class DBHelper {private Connection conn = null; Pu
Conditions similar to: a=5 or (a=2 and b>3)Basicdblist endlist = new Basicdblist ();Basicdbobject forceend = new Basicdbobject ();Forceend.put ("status", 5);Basicdblist condlist = new Basicdblist ();Basicdbobject autoend = new Basicdbobject ();Condlist.add (New Basicdbobject ("status", 2));Condlist.add (New Basicdbobject ("EndTime", New Basicdbobject ("$lt", New Date ()));Autoend.put ("$and", condlist);Endlist.add (Forceend);Endlist.add (Autoend);Basicdbobject.put ("$or", endlist);A compound
Encounter a hole: for the following codeSelect * from where > ' 2015-11-1 ' and date'2015-11-5'Results can be obtained when executed in the client of PostgreSQL, but when executed in Java (the time range is a parameter, type string), such as Date gt;=#{startday} and date The execution times are as follows: (and for MySQL, it can be executed correctly in code.) ) not timestamp > character varyingWORKAROUND: Change the parameter of type string to Java
Look for a long time query Objectid method is wrong, with Mongovue can query out, but is using Java do not know how to query
1.mongovue Query mode:
Copy Code code as follows:
{"_id": ObjectId ("5326bfc0e6f780b21635248f")}
2. In the pure MongoDB
Use a hash in Java to query stock quotationsChina Construction Bank Yunnan Baoshan BranchYang shaofang---- In java, a hash table class Hashtable is provided. With this class, we can store data in a specific way to achieve quick retrieval. This article describes how to use java hash to
MyBatis Packet Paging query Java public classpaging----for queries with very large amounts of data. is indispensable.MyBatis the underlying paging SQL statement because it requires us to write manually. In the case of paging, we need to query the total number of records and records according to the condition of the paging que
The GetXXX () method of the 4:resultset object gets the data in the query result set. Because the data saved in ResultSet is in the form of a table, you can specify the column ordinal and column name by using the GetXXX () method. Id=rs.getint ("id");//Get ID Username=rs.getstring (2);// Password=rs.getstring ("password");// Age=rs.getint (4);// Sex=rs.getint (5);// You can understand it carefully, GetXXX (parameters), the parameter can be either the
Java obtains the query time between the first seven days and the last several days based on the current day.
Java obtains the query time between the first seven days and the last several days based on the current day.
Package com. kugou. schedu. service; import java. text.
Java connection to the mysql database and Content Query Method, javamysql
Recently, I used the framework to do several projects. I felt a little forgotten about the underlying things. I wrote a simple JDBC connection code to familiarize myself with this, I also hope it will be helpful for new users. This is also my first article. If you don't talk much about it, go directly to the Code:
Public Connection ge
Label:The first two articles describe how to configure MyEclipse and Tomcat to develop JSP Web sites, how to configure the servlet simple implementation form submission, this article mainly describes the configuration of MySQL implementation database connection MyEclipse, and finally the query table data displayed in the JSP Web page. The main picture is mainly described in the article, please Haihan ~Java+
Oracle technology _ 5 minutes will use stored procedure _ simple example of stored procedure (including loop, condition, add and modify query, parameter input, variable assignment, java call, etc.), oracle_5
Example business functions:
1. query the data in PROCEDURE_TEST_A table and PROCEDURE_TEST_A_SUB table based on the input type A_TYPE and display the main co
Java common query processing by start date and end datePackage Com.crm.mess.util;import Java.text.dateformat;import Java.text.parseexception;import Java.text.simpledateformat;import Java.util.date;public class Dateutil {//@Testpublic static string sedate (string Start, String end) throws parseexception {dateformat format = new SimpleDateFormat ("Yyyy/mm/dd HH:mm:ss");D ateformat form Atstr = new SimpleDateF
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.