Use JDBC to modify the Oracle sequence step in batches
Scenario
After the data migration is complete, you need to reset the sequence in the database ,.
Method
Three Common Methods
Delete-recreate
In this way, Simple Sequence reconstruction will affect the business logic processing and cannot adapt to the inconsistency of original sequence Parameter rules. However, if the sequence parameters are consistent,
data rollback failed!") ");}}Log.error ("Cleanup data failed with error message:" +ex.getmessage ());} finally {if (null! = conn) {try {Conn.close ();} catch (SQLException se) {Log.error ("Clean data, shut down database failed!");}}} The second type: in a separate query The amount of data in the SQL must not exceed 1000Workaround:For exampleSelect * FROM table_name where col in (' col1 ', ' col2 ' ...)If the item in the back is too large, this error will occur over 1000.The workaround is to:Sel
The 1.Spring built-in NativeJdbcExtractor converters include:C3p0nativejdbcextractorCommonsdbcpnativejdbcextractorJbossnativejdbcextractorNativeJdbcExtractorNativejdbcextractoradapterSimplenativejdbcextractorWeblogicnativejdbcextractorWebspherenativejdbcextractorXapoolnativejdbcextractorchange the server in a timely manner to avoid wasting a lot of time.located under Org\springframework\jdbc\support\nativejdbc Converting a connection from a database
JDBC reading of Oracle US7ASCII encoding Chinese garbled characters and the use of Chinese Characters in different encodings
Database Version: Oracle 10g
Character Set: SIMPLIFIED CHINESE_CHINA.US7ASCII
JDK: 1.6.0 _ 45
Oracle DRIVER: ojdbc14.jar
It is no problem to use JDBC
Label:I'm using a lite version of Oracle. 1 Importing an Oracle driver package Oracle Down Path D:\oracle\app\oracle\product\11.2.0\server\jdbc\lib\ojdbc6.jar 2 views Listenerduankouhao D:\o
JAVA-JDBC connecting Oracle databases, statement and PreparedStatement comparisons (querying query)
1. PreparedStatement Interface Inheritance Statement, the PreparedStatement instance contains compiled SQL statements, so it executes faster than the Statement object. 2. As a subclass of Statement, PreparedStatement inherits all the functions of Statement. Three methods execute, ExecuteQuery, and execu
Tags: ar using data problem as new database SQL CDatabase version: Oracle 10gCharacter set: Simplified Chinese_china. Us7asciiJdk:1.6.0_45Oracle Driver: Ojdbc14.jarUse JDBC to manipulate the database, get connections, execute SQL without problems. However, the results of the query, all Chinese characters, are displayed as garbled.Debug check See in the data from the database to get out of the time, is alrea
1. Find the available oracle jdbs driver jar package and place it in the specified directory (which can be customized as needed) D: \ jdbc \ ojdbc14.jar
2. Install maven. Configure the environment variable MAVEN_HOME = 'point to the maven installation directory'
3. Open the cmd window, jump to the D: \ jdbc directory, and execute the command
Mvn install: insta
") + "~" +rs.getstring ("sal") + "~" +rs.getstring ("comm") + "~" +rs.getstring (" Deptno)); } } //Access single return value store function create or Replace function X (Eno in number) return number//{? = call Public voidfunction ()throwsSQLException {String SQL= "{? = Call X (?)}"; Pager=conn.preparecall (SQL); //the input is the same as before PreparestatementCall.setint (2, 7788); //what type of output is the parameter to register?Call.registeroutparameter (1, Oracletypes.numb
Oracle transaction processing and instance demonstration jdbc operation batch DeletionTransactions
As the basic unit of logical processing, database operations are composed of one or more SQL statements. Of course, there are also non-database operations, such as the Restore Point Set in the computer is a good application.
The basic nature of transactions is described in another article: SQL transactions and
How to connect MySQL, Oracle, SQL Server database JDBC mysql: add a MySQL jar package first String url= "jdbc:mysql://localhost:3306/database name"; //Database address String name= "root";//database user name String password= "123456";// Database user Password Class.forName ("Com.mysql.jdbc.Driver");//load MySQL driver Connection conn = Drivermanager.getconnection ( Url,name,passWOrd);//Connection
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.