`
iloveflower
  • 浏览: 76757 次
社区版块
存档分类
最新评论
  • iloveflower: 呵呵。好好学习。。。。。。。。。。。。
    java 读书
  • Eric.Yan: 看了一点,不过是电子版的……你这一说到提醒我了,还要继续学习哈 ...
    java 读书
文章列表
Let’s see how we can perform batch insert in Java using JDBC APIs. Although you might already knew this, I will try to explain the basic to a bit complex scenarios. In this note, we will see how we can use JDBC APIs like Statement and PreparedStatement to insert data in any database in batches. Also ...

JDBC basic

    博客分类:
  • JDBC
The JDBC ( Java Database Connectivity) API defines interfaces and classes for writing database applications in Java by making database connections. Using JDBC you can send SQL, PL/SQL statements to almost any relational database. JDBC is a Java API for executing SQL statements and supports basic SQL ...
jdbc程序的性能主要由两个因素决定,一是数据库本身的性质,另一个是与数据库相对独立的jdbc应用程序接口(api)的使用.这里说的是如何正确使用jdbc编程接口,以获得更好的性能.   jdbc主要优化有:      1.选择正确的jdbc驱动程序      2.Connention的优化  使用连接池来管理Connection对象      3.Statement的优化   使用批量更新等      4.Result的优化  正确的从数据库中get数据等            (1)选择正确的jdbc驱动程序:   1 jdbc-odbc 桥             2 本 ...
cd c:\mysql\bin start server 1) mysqld start 2, connect server mysql -h localhost -u root -p 3) show databases; 4) connect database;
语 句 功 能 --数据操作   SELECT --从数据库表中检索数据行和列   INSERT --向数据库表添加新数据行   DELETE --从数据库表中删除数据行   UPDATE --更新数据库表中的数据 --数据定义   CREATE TABLE --创建一个数据库表   DROP TABLE --从数据库中删除表   ALTER TABLE --修改数据库表结构   CREATE VIEW --创建一个视图   DROP VIEW --从数据库中删除视图   CREATE INDEX --为数据库表创建一个索引   DROP INDEX --从数据库中删除 ...
Collection:List、Set Map:HashMap、HashTable 如何在它们之间选择 一、Array , Arrays Java所有“存储及随机访问一连串对象”的做法,array是最有效率的一种。 1、 效率高,但容量固定且无法动态改变。 array还有一个缺点是,无法判 ...
I have a list of objects I need to sort on a field, say Score. Without giving much thought I wrote a new class that implements Comparator, that does the task and it works. Now looking back at this, I am wondering if I should have instead have the my class implement Comparable instead of creating ...
How can I fill a multidimensional array in Java without using a loop? I've tried: double[][] arr = new double[20][4]; Arrays.fill(arr, 0); This results in java.lang.ArrayStoreException: java.lang.Double Thanks in advance! Another way to do this without a loop is to use tail recursion. Y ...
Immutable objects are simply objects whose state (the object's data) cannot change after construction. Examples of immutable objects from the JDK include String and Integer. Immutable objects greatly simplify your program, since they : ■ are simple to construct, test, and use ■ are automatical ...
Below is the syntax highlighted version of Transaction.java from § Algorithms. /************************************************************************* * Compilation: javac Transaction.java * Execution: java Transaction * * Data type for commercial transactions. * ********* ...
http://www.javapractices.com/topic/TopicAction.do;jsessionid=6E104A048475638493BA555238EC17F4?Id=34 Lazy initialization is a performance optimization. It's used when data is deemed to be 'expensive' for some reason. For example: ■if the hashCode value for an object might not actually be needed by it ...
A common mistake for a beginner to Java is to try and write some more or less complex method for sorting an array when in fact it can be done with just one line of code. The Arrays class has a static method called sort which exists in many overloaded versions so you can pass in an array of any primit ...
各种数字类型转换成字符串型: String s = String.valueOf( value); // 其中 value 为任意一种数字类型。 字符串型转换成各种数字类型: String s = "169"; byte b = Byte.parseByte( s ); short t = Short.parseShort( s ); int i = Integer.parseInt( s ); long l = Long.parseLong( s ); Float f = Float.parseFloat( s ); Double d = Doubl ...

regular expression

1、Java对反斜线处理的问题 在其他语言中,\\表示要插入一个字符\; 在Java语言中,\\表示要插入正则表达式的反斜线,并且后面的字符有特殊意义。 看API文档: 预定义字符类 . 任何字符(与行结束符可能匹配也可能 ...
import java.util.*; public class AppendEle { public List<String> getAppendList(List<String> inputList) { List<String> result = new ArrayList<String>(); StringBuilder tsb = new StringBuilder(); for (int iCnt=0; iCnt< inputList.size()-1; iCnt++) { tsb.se ...
Global site tag (gtag.js) - Google Analytics