Tablespace design reflects the insert speed?
I have a not complicated insert statement which inserts about 15,000,000 rows, effects 2 tables to select and 1 to insert. No blocks, locks, etc.
When I run it on development server it took about 8 hours to complete.
On the test server, it run for 2 days and did not finish - the speed is about 40000 records per 1 hour. The same number of records, the same indexes and I did compute the statistics before the process.
Oracle 9.2.4, Sunsolaris - the same patches for operating system and Oracle.
The tablespaces parameters though are different...
What could I look at to improve the performance?
Thanks a lot.
Solution: 1) BULK insert
Open c_emp;
Loop
EXIT when c_emp%notfound;
fetch c_emp BULK COLLECT into v_type_tab LIMIT 1000;
End Loop;
Solution: 2) insert through Select
Insert into insert_table_name select * from select_table_name;
Similar Messages
-
Delete all record in a table, the insert speed is not change.
I have an empty table, and i insert a record need 100ms,
when this table has 40,0000 record, i insert a record need 1s, this is ok, because i need do a compare based an index before insert a record, so more record, need more time.
The problem is when i delete all record in this table, the insert time is still 1s, not reduce to 100ms.Why?Hello,
Read through this portion of oracle documentation
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/logical.htm#CNCPT004
The reason is still taking 1s, because when you inserted 400K record because HWM (The high water mark is the boundary between used and unused space in a segment.) moved up. And when you deleted all the records your HWM still at the same marker and didn't get to reset to 0. So when you insert 1 record it lookings for free space and after finding (generally a regular inserts got 6 steps it inserts data). If you truncate your table you and try it again it will be faster as your HWM is reset to 0.
Regards -
Hello.
I have a db which has 5M records and has 2 secondary associated dbs.
ENV uses 800M cache.
I have checked speed of insertion, and how long took to populate every 100,000 records.
before 3M records, it took about 10 sec. to insert every 100,000 records.
I think that's very nice.
But after 3M inserted, it took about 100 sec. to insert every 100,000 records.
overall, it took 20 minutes to insert 5M records.
Is there any solution improving performance without having more cache?
Thanks.
ps.
* Primary DB's file size is 4.9GB
* 2 Secondary DB's file size is 700MB
* I'm not using transactions.
Result of Insert Test
inserted rows seconds to insert 100,000 records
100,000 5.5
200,000 4.5
300,000 5.6
400,000 5.8
500,000 5.4
600,000 6.7
700,000 5.2
800,000 9.5
900,000 8.1
1,000,000 10
1,100,000 10.8
1,200,000 9.9
1,300,000 10.7
1,400,000 11
1,500,000 11.8
1,600,000 9.6
1,700,000 10.6
1,800,000 10.9
1,900,000 12.2
2,000,000 11
2,100,000 10.8
2,200,000 10.9
2,300,000 11.7
2,400,000 11.1
2,500,000 13.9
2,600,000 10.7
2,700,000 10.6
2,800,000 11.4
2,900,000 11.3
3,000,000 24.2
3,100,000 45.4
3,200,000 53
3,300,000 38
3,400,000 59.4
3,500,000 81.8
3,600,000 83.8
3,700,000 95.6
3,800,000 79
3,900,000 75.8
4,000,000 80.9
4,100,000 98
4,200,000 117.8
4,300,000 110
4,400,000 96
4,500,000 82
4,600,000 101
4,700,000 104
4,800,000 109
4,900,000 110
4,931,099 20
Message was edited by:
wertyu
Message was edited by:
wertyu
Message was edited by:
wertyuHello.
I have a db which has 5M records and has 2 secondary
associated dbs.
ENV uses 800M cache.
I have checked speed of insertion, and how long took
to populate every 100,000 records.
before 3M records, it took about 10 sec. to insert
every 100,000 records.
I think that's very nice.
But after 3M inserted, it took about 100 sec. to
insert every 100,000 records.You did not mention what hardware you run on. I can give you some numbers that I'm seeing on my MacBook Pro (2.4 Ghz, slow laptop disk)
My records are 40 bytes and my keys are 20 bytes. With two secondary indexes I'm inserting those with about 20.000 records per second. The insert speed is pretty constant, whether I'm testing with 200.000 or 10.000.000 million records.
The one thing that is completely killing performance is doing an import from some dump file on the same filesystem that ie being read record by record. If I do that then I see your speed pattern, first few go fast, then it drops.
What worked very well for me was to read all or large chunks of import files into memory. Then there is mostly write access to the database files and nothing else. Speeds up many times.
S. -
We have the SharePoint Server 2010 with SP1 environment on which the custom SP2010 designer pages were working as expected before the
August 13, 2013 CU has installed. But, getting the below exception while trying to add the new item after the CU has installed.
Error while executing web part: System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SharePoint.WebControls.SPDataSourceView.ExecuteInsert(IDictionary values) at
System.Web.UI.DataSourceView.Insert(IDictionary values, DataSourceViewOperationCallback callback) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
06/19/2014 16:49:37.65 w3wp.exe (0x1240) 0x1300 SharePoint Foundation
Runtime tkau Unexpected Microsoft.SharePoint.WebPartPages.DataFormWebPartException: The data source control
failed to execute the insert command. 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc at Microsoft.SharePoint.WebPartPages.DataFormWebPart.InsertCallback(Int32 affectedRecords, Exception ex) at System.Web.UI.DataSourceView.Insert(IDictionary
values, DataSourceViewOperationCallback callback) at Microsoft.SharePoint.WebPartPages.DataFormWebPart.FlatCommit() at Microsoft.SharePoint.WebPartPages.DataFormWebPart.HandleOnSave(Object sender, EventArgs e)
at Microsoft.SharePoint.WebPartPages.DataFormWebPart.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.ProcessRequestMain(Boolean
inclu... 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
06/19/2014 16:49:37.65* w3wp.exe (0x1240) 0x1300 SharePoint Foundation
Runtime tkau Unexpected ...deStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 3b64c3a0-48f3-4d4a-af54-d0a2fc4553cc
I have tried changing the "DataSourceMode" as below, now the insert command is working, but update command is not working.
<SharePoint:SPDataSource runat="server" DataSourceMode="ListItem" />
Also, the lookup dropdown fields are displaying the value as "<a href="Daughterhttp://cpsp10/sites/Employees/_layouts/listform.aspx?PageType=4&ListId={8F62F444-FB6A-4F03-9522-C4696B45DCD1}&ID=10&RootFolder=*">Daughter</a>"
instead of only "Daughter".
Please provide the solution to get rid of this issue.
Thanks
RamasubbuTry below:
http://social.technet.microsoft.com/Forums/en-US/ae910269-3a0c-4506-844b-e8bc89d95b71/data-source-control-failed-to-execute-the-insert-command
http://blog.jussipalo.com/2012/01/sharepoint-2010-data-source-control.html
While there can be many causes for this generic error message, in my case the first parameter or ddwrt:DataBind function inside the SharePoint:FormFields element was
'i' and I was working with an Edit Form. Changing it to
'u' as it was with every other FormField fixed the issue.
<SharePoint:FormField runat="server" id="ff1{$Pos}" ControlMode="Edit" FieldName="Esittaja" __designer:bind="{ddwrt:DataBind('u',concat('ff1',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Esittaja')}"
/>
Explanation:
DataBind operation type parameters (the first parameter) are listed below:
'i' stands for INSERT,
'u' stands for UPDATE,
'd' stands for DELETE.
http://webcache.googleusercontent.com/search?q=cache:d9HHY4I7omgJ:thearkfloats.blogspot.com/2014/03/sharepoint-2010-data-source-control.html+&cd=4&hl=en&ct=clnk&gl=in
If this helped you resolve your issue, please mark it Answered -
Using the Insert statement in a Java program without hardcoding the data
hello.
this is james mcfadden. i have developed a program called Demo.java, which is used with another program called QueryTableModel.java (a program that allows data to be viewed in a JTable). The Demo.java program displays a menu, connects to a database, allows the user to add data into the database and allows the user to view data that is already in the database. I have a problem with the Demo.java program. I have hardcoded the Insert statement in it. How do you use the Insert statement to put data into a database without hardcoding the data?
import java.awt.*;//Contains all of the classes for creating user interfaces and for painting graphics and images
import java.awt.event.*;//Provides interfaces and classes for dealing with different types of events fired by AWT components
import javax.swing.*;//Provides a set of lightweight components that, to the maximum degree possible, work the same on all platforms
import javax.swing.table.*;//Provides classes and interfaces for dealing with javax.swing.JTable
import javax.swing.JOptionPane;//provides a class that makes it easy to pop up a standard dialog box that prompts users for a value or informs them of something
import java.sql.*;//Provides the API for accessing and processing data stored in a data source using the Java programming language
public class Demo extends JFrame{
static String url = "jdbc:odbc:VideoLibrary";//a static variable that allows a connection to be made to a database called VideoLibrary
static Statement stmt;//a static variable that allows a statement to be made once a connection is set up
static Connection con;//a static interface that allows a connection to be made to a database
//global variables
JTextField hostField;//a class that allows a line of text to be changed
JTextField queryField;//a class that allows a line of text to be changed
QueryTableModel qtm;//a class that shows and changes regular two-dimensional tables of cells
JComboBox comboBox;//a class that puts a button or editable field and a drop-down list together
public static void main(String args[]){
int choice=-1;//a variable of type int that is set to -1
do{
choice=getChoice();//invokes the method getChoice()
if(choice!=0){
getSelected(choice);//invokes the method getSelected(choice)
}//end if
//if the user chooses 5, it will cause him or her to exit the system
}while(choice!=5);//end do-while
System.exit(0);//closes down the menu screen
}//end main
public static int getChoice(){
String choice;//a variable of type string
int ch;//a variable of type int
choice = JOptionPane.showInputDialog(null,"1. Maintain product details\n"+"2. Maintain member details\n"+"3. Maintain rental details\n"+"4. View product, member and rental details\n"+"5. Log Off\n\n"+"Enter your choice");//asks the user for some input
ch = Integer.parseInt(choice);//a class that wraps a value of the primitive type int in an object
return ch;//a method that returns an integer value
}//end getChoice
public static void getSelected(int choice){
if(choice==1){
maintainProductDetails();//invokes the method maintainProductDetails()
}//end if
if(choice==2){
maintainMemberDetails();//invokes the method maintainMemberDetails()
}//end if
if(choice==3){
maintainRentalDetails();//invokes the method maintainRentalDetails()
}//end if
if(choice==4){
Demo test = new Demo();//invokes the constructor Demo()
test.setVisible(true);//shows the JTable component by marking it as visible
}//end if
}//end getSelected
public static Connection getConnection(){
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//used to create a JDBC connection using a database
}//end try
catch(java.lang.ClassNotFoundException e){//causes an exception to be thrown when an application tries to load in a class through its string name
System.err.print("ClassNotFoundException: ");//displays an error message
System.err.println(e.getMessage());//returns the exception that was raised if an error occurred while attempting to load the ClassNotFoundException class
}//end catch
try {
con=DriverManager.getConnection(url,"","");//tries to create a connection with the database using the DriverManager class
}//end try
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());//returns an SQL error message
}//end catch
return con;
}//end getConnection
public static void maintainProductDetails(){
Connection con = getConnection();//creates a connection with the database
String addProduct1, addProduct2, addProduct3, addProduct4, addProduct5, addProduct6, addProduct7, addProduct8, addProduct9, addProduct10;//string variables that represent information about the different types of product data that will be stored in the database
addProduct1 = "insert into Product values (110001, 'The Killers - Sams Town', 5.00, 'G', 'CD', 2006)";
addProduct2 = "insert into Product values (110002, 'Robbie Williams - Rudebox', 5.00, 'G', 'CD', 2006)";
addProduct3 = "insert into Product values (110003, 'Razorlight - Razorlight', 5.00, 'G', 'CD', 2006)";
addProduct4 = "insert into Product values (110004, 'My Chemical Romance - The Black Parade', 5.00, 'G', 'CD', 2006)";
addProduct5 = "insert into Product values (110005, 'Snow Patrol - Eyes Open', 5.00, 'G', 'CD', 2006)";
addProduct6 = "insert into Product values (110006, 'Scissor Sisters - Ta-Dah!', 5.00, 'G', 'CD', 2006)";
addProduct7 = "insert into Product values (110007, 'Lovesounds - Justin Timberlake', 5.00, 'G', 'CD', 2006)";
addProduct8 = "insert into Product values (110008, 'Director - We thrive on big cities', 5.00, 'G', 'CD', 2006)";
addProduct9 = "insert into Product values (110009, 'Roxette - Roxette hits', 5.00, 'G', 'CD', 2006)";
addProduct10 = "insert into Product values (110010, 'Pussy Cat Dolls - PCD', 5.00, 'G', 'CD', 2006)";
try {
stmt = con.createStatement();//Creates a Statement object for sending SQL statements to the database
//statements are allowed to be made once a connection is set up
stmt.executeUpdate(addProduct1);
stmt.executeUpdate(addProduct2);
stmt.executeUpdate(addProduct3);
stmt.executeUpdate(addProduct4);
stmt.executeUpdate(addProduct5);
stmt.executeUpdate(addProduct6);
stmt.executeUpdate(addProduct7);
stmt.executeUpdate(addProduct8);
stmt.executeUpdate(addProduct9);
stmt.executeUpdate(addProduct10);
stmt.close();//closes the Statement object
con.close();//terminates the connection with the database
}//end try
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());//returns an SQL error message
}//end catch
}//end maintainProductDetails
public static void maintainMemberDetails(){
Connection con = getConnection();//creates a connection with the database
String addMember1, addMember2, addMember3, addMember4, addMember5, addMember6, addMember7, addMember8, addMember9, addMember10;//string variables that represent information about the member data that will be stored in the database
addMember1 = "insert into Member values (1234, 'Ann', 'Smyth', 'Upper Killult, Falcarragh, Co. Donegal', '(074)-9135210', '(087)-2030172', #5/11/85#, #5/12/06#)";
addMember2 = "insert into Member values (2345, 'John', 'Murphy', 'Lower Killult, Falcarragh, Co. Donegal', '(074)-9135211', '(087)-2030173', #4/12/85#, #6/13/06#)";
addMember3 = "insert into Member values (1324, 'James', 'McFadden', 'Lower Ardsbeg, Gortahork, Co. Donegal', '(074)-9165314', '(087)-2030171', #4/11/85#, #6/14/06#)";
addMember4 = "insert into Member values (1235, 'Frankie', 'Ferry', 'Ardsmore, Gortahork, Co. Donegal', '(074)-9165325', '(087)-2031234', #6/13/60#, #6/15/06#)";
addMember5 = "insert into Member values (1236, 'Daniel', 'McKimm', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135212', '(087)-2030184', #5/14/73#, #6/16/06#)";
addMember6 = "insert into Member values (2346, 'Stephen', 'Doohan', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135213', '(087)-2030185', #6/13/85#, #5/13/06#)";
addMember7 = "insert into Member values (2347, 'James', 'Ferry', 'Meenlaragh, Gortahork, Co.Donegal', '(074)-9165360', '(087)-2031345', #9/12/85#, #5/14/06#)";
addMember8 = "insert into Member values (2348, 'Liam', 'Cannon', 'Derryconner, Gortahork, Co.Donegal', '(074)-9165324', '(087)-2031456', #4/11/86#, #5/15/06#)";
addMember9 = "insert into Member values (2401, 'Ciaran', 'Ferry', 'Brinalack, Gweedore, Co.Donegal', '(074)-9176425', '(087)-2030282', #9/12/85#, #5/16/06#)";
addMember10 = "insert into Member values (2402, 'Ciaran', 'McGee', 'Derrybeg, Gweedore, Co.Donegal', '(074)-9176536', '(087)-2030393', #9/14/85#, #5/18/06#)";
try{
stmt = con.createStatement();//Creates a Statement object for sending SQL statements to the database
//statements are allowed to be made once a connection is set up
stmt.executeUpdate(addMember1);
stmt.executeUpdate(addMember2);
stmt.executeUpdate(addMember3);
stmt.executeUpdate(addMember4);
stmt.executeUpdate(addMember5);
stmt.executeUpdate(addMember6);
stmt.executeUpdate(addMember7);
stmt.executeUpdate(addMember8);
stmt.executeUpdate(addMember9);
stmt.executeUpdate(addMember10);
stmt.close();//closes the Statement object
con.close();//terminates the connection with the database
}//end try
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());//returns an SQL error message
}//end catch
}//end maintainMemberDetails
public static void maintainRentalDetails(){
Connection con = getConnection();//creates a connection with the database
String addRental1, addRental2, addRental3, addRental4, addRental5, addRental6, addRental7, addRental8, addRental9, addRental10;//string variables that represent information about the loan data that will be stored in the database
addRental1 = "insert into Rental values (110001, 'The Killers - Sams Town', 1234, 'Ann', 'Smyth', #9/01/06#, #9/10/06#, 'Yes', 2.00)";
addRental2 = "insert into Rental values (120001, 'Mission Impossible 3', 2345, 'John', 'Murphy', #9/02/06#, #9/09/06#, 'No', 0.00)";
addRental3 = "insert into Rental values (130001, 'Need for Special Carbon', 1324, 'James', 'McFadden', #9/03/06#, #9/12/06#, 'Yes', 2.00)";
addRental4 = "insert into Rental values (110002, 'Robbie Williams - Rudebox', 1235, 'Frankie', 'Ferry', #9/04/06#, #9/11/06#, 'No', 0.00)";
addRental5 = "insert into Rental values (120015, 'Prime', 1236, 'Daniel', 'McKimm', #9/05/06#, #9/14/06#, 'Yes', 2.00)";
addRental6 = "insert into Rental values (130015, 'FIFA 07', 2346, 'Stephen', 'Doohan', #9/06/06#, #9/13/06#, 'No', 0.00)";
addRental7 = "insert into Rental values (110009, 'Roxette - Roxette hits', 2347, 'James', 'Ferry', #9/07/06#, #9/16/06#, 'Yes', 2.00)";
addRental8 = "insert into Rental values (120003, 'The Break Up', 2348, 'Liam', 'Cannon', #9/08/06#, #9/15/06#, 'No', 0.00)";
addRental9 = "insert into Rental values (130027, 'Gears of War', 2401, 'Ciaran', 'Ferry', #9/09/06#, #9/18/06#, 'Yes', 2.00)";
addRental10 = "insert into Rental values (110021, 'Scooter - Mind the Gap', 2402, 'Ciaran', 'McGee', #9/10/06#, #9/17/06#, 'No', 0.00)";
try{
stmt = con.createStatement();//Creates a Statement object for sending SQL statements to the database
//statements are allowed to be made once a connection is set up
stmt.executeUpdate(addRental1);
stmt.executeUpdate(addRental2);
stmt.executeUpdate(addRental3);
stmt.executeUpdate(addRental4);
stmt.executeUpdate(addRental5);
stmt.executeUpdate(addRental6);
stmt.executeUpdate(addRental7);
stmt.executeUpdate(addRental8);
stmt.executeUpdate(addRental9);
stmt.executeUpdate(addRental10);
stmt.close();//closes the Statement object
con.close();//terminates the connection with the database
}//end try
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());//returns an SQL error message
}//end catch
}//end maintainRentalDetails
public Demo(){//a constructor
super("Demo Test Frame");//overrides the constructor
setSize(350, 200);//Resizes this component so that it has width of 350 and height of 200
comboBox = new JComboBox();//invokes the class JComboBox
comboBox.addItem("jdbc:odbc:VideoLibrary");//adds the specified item to the end of the scrolling list
qtm = new QueryTableModel();//invokes the class QueryTableModel
JTable table = new JTable(qtm);//a class that shows and changes regular two-dimensional tables of cells
JScrollPane scrollpane = new JScrollPane(table);//a class that provides a scrollable view of a lightweight component
JPanel p1 = new JPanel();//a class that puts the combo box and query field in a panel
p1.setLayout(new GridLayout(3, 2));//Sets the layout manager for this container
p1.add(comboBox);//Appends the specified component to the end of this container
p1.add(new JLabel("Enter your query: "));//Appends the specified component to the end of this container
p1.add(queryField = new JTextField());//Appends the specified component to the end of this container
p1.add(new JLabel("Click here to send: "));//Appends the specified component to the end of this container
JButton jb = new JButton("Search");//a class that is an implementation of a "push" button
jb.addActionListener(new ActionListener(){//Adds an ActionListener to the button
public void actionPerformed(ActionEvent e){
qtm.setHostURL();//invokes the method setHostURL
qtm.setQuery(queryField.getText().trim());//invokes the method setQuery; and returns the text that is presented by this text component and returns a copy of the string, with leading and trailing whitespaces omitted
} );//end addActionListener
p1.add(jb);//Appends the specified component to the end of this container
getContentPane().add(p1, BorderLayout.NORTH);//Returns the content pane
getContentPane().add(scrollpane, BorderLayout.CENTER);//Returns the content pane
}//end Demo
}//end class Demo
import java.sql.*;//Provides the API for accessing and processing data stored in a data source using the Java programming language
import java.io.*;//Provides for system input and output through data streams, serialization and the file system
import java.util.Vector;//provides a class that implements a growable array of objects
import javax.swing.*;//Provides a set of lightweight components that, to the maximum degree possible, work the same on all platforms
import javax.swing.table.*;//Provides classes and interfaces for dealing with javax.swing.JTable
public class QueryTableModel extends AbstractTableModel{
Vector cache;//a class that constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero
int colCount;//a variable that counts the number of columns in the three tables
String[] headers;//a class that represents character strings and all string literals in this program are implemented as instances of the String class
Connection db;//an interface that allows a connection to be made to a database
Statement statement;//an interface that allows executes the given SQL statement, which returns a single ResultSet object
String currentURL;//a variable that allows the URL to be displayed in a combo box
public QueryTableModel(){//a constructor
cache=new Vector();//constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//used by opening a JDBC connection using an URL
}//end try
catch(Exception e){
System.out.println("problem loading the driver ");//an error message
}//end catch
}//end QueryTableModel
public String getColumnName(int i){//Returns the designated column's name
return headers;//returns the name of each column in the three table
}//end getColumnName
public int getColumnCount(){//Returns the number of columns in the column model
return colCount;//returns the number of columns in the three tables
}//end getColumnCount
public int getRowCount(){//Returns the number of rows in this table's model
return cache.size();//returns the number of components in the vector
}//end getRowCount
public Object getValueAt(int row, int col){//Returns the cell value at row and column
return ((String[])cache.elementAt(row))[col];//Returns the component at the specified index
}//end getValueAt
public void setHostURL(){//sets the URL for the database
String url = "jdbc:odbc:VideoLibrary";//a variable that allows a connection to be made to a database called VideoLibrary
closeDB();//invokes the method closeDB()
try{
db=DriverManager.getConnection(url,"","");//tries to create a connection with the database using the DriverManager class
statement=db.createStatement();//Creates a Statement object for sending SQL statements to the database
}//end try
catch(Exception e){
System.out.println("Could not initialize the database.");//an error message
e.printStackTrace();//a Throwable method that prints this throwable and it's backtrace to the standard error stream
}//end catch
}//end setHostURL
public void setQuery(String q){//sets the kind of query that is to be sent to the database
cache=new Vector();//constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero
String s="select * from Product";//a variable that causes all the data that is in the product table to be displayed in a JTable, which also means that all the data that is in both the member and rental tables can also be displayed in a JTable
try{
ResultSet rs=statement.executeQuery(q);//an interface that is used to generate a database result set by executing a statement that queries the database
ResultSetMetaData meta=rs.getMetaData();//an interface that is used to get information about the types and properties of the columns in a ResultSet object
colCount=meta.getColumnCount();//Returns the number of columns in this ResultSet object
headers=new String[colCount];//gets the name of each column in the three tables
for(int h=1;h<=colCount;h++){
headers[h-1]=meta.getColumnName(h);//Get the designated column's name
}//end for
while(rs.next()){
String[] record=new String[colCount];//stores the name of each column in the three tables in memory
for(int i=0;i<colCount;i++){
record[i]=rs.getString(i+1);//Retrieves the value of the designated column in the current row of this ResultSet object as a String
}//end for
cache.addElement(record);//Adds the specified component to the end of this vector, increasing its size by one
}//end while
fireTableChanged(null);//Forwards the given notification event to all TableModelListeners that registered themselves as listeners for this table model
}//end try
catch(Exception e){
cache=new Vector();//constructs an empty vector so that its internal data array has size 10 and its standard capacity increment is zero
e.printStackTrace();//a Throwable method that prints this throwable and it's backtrace to the standard error stream
}//end catch
}//end setQuery
public void initDB(String url){
try{
db=DriverManager.getConnection(url);//tries to create a connection with the database using the DriverManager class
statement=db.createStatement();//Creates a Statement object for sending SQL statements to the database
}//end try
catch(Exception e){
System.out.println("Could not initialize the database.");//an error message
e.printStackTrace();//a Throwable method that prints this throwable and it's backtrace to the standard error stream
}//end catch
}//end initDB
public void closeDB(){
try{
if(statement!=null){
statement.close();//Releases this Statement object's database and JDBC resources immediately instead of waiting for this to happen when it is automatically closed
}//end if
if(db!=null){
db.close();//Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released
}//end if
}//end try
catch(Exception e){
System.out.println("Could not close the current connection.");//an error message
e.printStackTrace();//a Throwable method that prints this throwable and it's backtrace to the standard error stream
}//end catch
}//end closeDB
}//end class QueryTableModelhere's an uncommented version of the code.
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.JOptionPane;
import java.sql.*;
public class Demo extends JFrame{
static String url = "jdbc:odbc:VideoLibrary";
static Statement stmt;
static Connection con;
JTextField hostField;
JTextField queryField;
QueryTableModel qtm;
JComboBox comboBox;
public static void main(String args[]){
int choice=-1;
do{
choice=getChoice();
if(choice!=0){
getSelected(choice);
}while(choice!=5);
System.exit(0);
public static int getChoice(){
String choice;
int ch;
choice = JOptionPane.showInputDialog(null,"1. Maintain product details\n"+"2. Maintain member details\n"+"3. Maintain rental details\n"+"4. View product, member and rental details\n"+"5. Log Off\n\n"+"Enter your choice");
ch = Integer.parseInt(choice);
return ch;
public static void getSelected(int choice){
if(choice==1){
maintainProductDetails();
if(choice==2){
maintainMemberDetails();
if(choice==3){
maintainRentalDetails();
if(choice==4){
Demo test = new Demo();
test.setVisible(true);
public static Connection getConnection(){
try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch(java.lang.ClassNotFoundException e){
System.err.print("ClassNotFoundException: ");
System.err.println(e.getMessage());
try {
con=DriverManager.getConnection(url,"","");
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
return con;
public static void maintainProductDetails(){
Connection con = getConnection();
String addProduct1, addProduct2, addProduct3, addProduct4, addProduct5, addProduct6, addProduct7, addProduct8, addProduct9, addProduct10;
addProduct1 = "insert into Product values (110001, 'The Killers - Sams Town', 5.00, 'G', 'CD', 2006)";
addProduct2 = "insert into Product values (110002, 'Robbie Williams - Rudebox', 5.00, 'G', 'CD', 2006)";
addProduct3 = "insert into Product values (110003, 'Razorlight - Razorlight', 5.00, 'G', 'CD', 2006)";
addProduct4 = "insert into Product values (110004, 'My Chemical Romance - The Black Parade', 5.00, 'G', 'CD', 2006)";
addProduct5 = "insert into Product values (110005, 'Snow Patrol - Eyes Open', 5.00, 'G', 'CD', 2006)";
addProduct6 = "insert into Product values (110006, 'Scissor Sisters - Ta-Dah!', 5.00, 'G', 'CD', 2006)";
addProduct7 = "insert into Product values (110007, 'Lovesounds - Justin Timberlake', 5.00, 'G', 'CD', 2006)";
addProduct8 = "insert into Product values (110008, 'Director - We thrive on big cities', 5.00, 'G', 'CD', 2006)";
addProduct9 = "insert into Product values (110009, 'Roxette - Roxette hits', 5.00, 'G', 'CD', 2006)";
addProduct10 = "insert into Product values (110010, '***** Cat Dolls - PCD', 5.00, 'G', 'CD', 2006)";
try {
stmt = con.createStatement();
stmt.executeUpdate(addProduct1);
stmt.executeUpdate(addProduct2);
stmt.executeUpdate(addProduct3);
stmt.executeUpdate(addProduct4);
stmt.executeUpdate(addProduct5);
stmt.executeUpdate(addProduct6);
stmt.executeUpdate(addProduct7);
stmt.executeUpdate(addProduct8);
stmt.executeUpdate(addProduct9);
stmt.executeUpdate(addProduct10);
stmt.close();
con.close();
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
public static void maintainMemberDetails(){
Connection con = getConnection();
String addMember1, addMember2, addMember3, addMember4, addMember5, addMember6, addMember7, addMember8, addMember9, addMember10;
addMember1 = "insert into Member values (1234, 'Ann', 'Smyth', 'Upper Killult, Falcarragh, Co. Donegal', '(074)-9135210', '(087)-2030172', #5/11/85#, #5/12/06#)";
addMember2 = "insert into Member values (2345, 'John', 'Murphy', 'Lower Killult, Falcarragh, Co. Donegal', '(074)-9135211', '(087)-2030173', #4/12/85#, #6/13/06#)";
addMember3 = "insert into Member values (1324, 'James', 'McFadden', 'Lower Ardsbeg, Gortahork, Co. Donegal', '(074)-9165314', '(087)-2030171', #4/11/85#, #6/14/06#)";
addMember4 = "insert into Member values (1235, 'Frankie', 'Ferry', 'Ardsmore, Gortahork, Co. Donegal', '(074)-9165325', '(087)-2031234', #6/13/60#, #6/15/06#)";
addMember5 = "insert into Member values (1236, 'Daniel', 'McKimm', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135212', '(087)-2030184', #5/14/73#, #6/16/06#)";
addMember6 = "insert into Member values (2346, 'Stephen', 'Doohan', 'Ballyness, Falcarragh, Co. Donegal', '(074)-9135213', '(087)-2030185', #6/13/85#, #5/13/06#)";
addMember7 = "insert into Member values (2347, 'James', 'Ferry', 'Meenlaragh, Gortahork, Co.Donegal', '(074)-9165360', '(087)-2031345', #9/12/85#, #5/14/06#)";
addMember8 = "insert into Member values (2348, 'Liam', 'Cannon', 'Derryconner, Gortahork, Co.Donegal', '(074)-9165324', '(087)-2031456', #4/11/86#, #5/15/06#)";
addMember9 = "insert into Member values (2401, 'Ciaran', 'Ferry', 'Brinalack, Gweedore, Co.Donegal', '(074)-9176425', '(087)-2030282', #9/12/85#, #5/16/06#)";
addMember10 = "insert into Member values (2402, 'Ciaran', 'McGee', 'Derrybeg, Gweedore, Co.Donegal', '(074)-9176536', '(087)-2030393', #9/14/85#, #5/18/06#)";
try{
stmt = con.createStatement();
stmt.executeUpdate(addMember1);
stmt.executeUpdate(addMember2);
stmt.executeUpdate(addMember3);
stmt.executeUpdate(addMember4);
stmt.executeUpdate(addMember5);
stmt.executeUpdate(addMember6);
stmt.executeUpdate(addMember7);
stmt.executeUpdate(addMember8);
stmt.executeUpdate(addMember9);
stmt.executeUpdate(addMember10);
stmt.close();
con.close();
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
public static void maintainRentalDetails(){
Connection con = getConnection();
String addRental1, addRental2, addRental3, addRental4, addRental5, addRental6, addRental7, addRental8, addRental9, addRental10;
addRental1 = "insert into Rental values (110001, 'The Killers - Sams Town', 1234, 'Ann', 'Smyth', #9/01/06#, #9/10/06#, 'Yes', 2.00)";
addRental2 = "insert into Rental values (120001, 'Mission Impossible 3', 2345, 'John', 'Murphy', #9/02/06#, #9/09/06#, 'No', 0.00)";
addRental3 = "insert into Rental values (130001, 'Need for Special Carbon', 1324, 'James', 'McFadden', #9/03/06#, #9/12/06#, 'Yes', 2.00)";
addRental4 = "insert into Rental values (110002, 'Robbie Williams - Rudebox', 1235, 'Frankie', 'Ferry', #9/04/06#, #9/11/06#, 'No', 0.00)";
addRental5 = "insert into Rental values (120015, 'Prime', 1236, 'Daniel', 'McKimm', #9/05/06#, #9/14/06#, 'Yes', 2.00)";
addRental6 = "insert into Rental values (130015, 'FIFA 07', 2346, 'Stephen', 'Doohan', #9/06/06#, #9/13/06#, 'No', 0.00)";
addRental7 = "insert into Rental values (110009, 'Roxette - Roxette hits', 2347, 'James', 'Ferry', #9/07/06#, #9/16/06#, 'Yes', 2.00)";
addRental8 = "insert into Rental values (120003, 'The Break Up', 2348, 'Liam', 'Cannon', #9/08/06#, #9/15/06#, 'No', 0.00)";
addRental9 = "insert into Rental values (130027, 'Gears of War', 2401, 'Ciaran', 'Ferry', #9/09/06#, #9/18/06#, 'Yes', 2.00)";
addRental10 = "insert into Rental values (110021, 'Scooter - Mind the Gap', 2402, 'Ciaran', 'McGee', #9/10/06#, #9/17/06#, 'No', 0.00)";
try{
stmt = con.createStatement();
stmt.executeUpdate(addRental1);
stmt.executeUpdate(addRental2);
stmt.executeUpdate(addRental3);
stmt.executeUpdate(addRental4);
stmt.executeUpdate(addRental5);
stmt.executeUpdate(addRental6);
stmt.executeUpdate(addRental7);
stmt.executeUpdate(addRental8);
stmt.executeUpdate(addRental9);
stmt.executeUpdate(addRental10);
stmt.close();
con.close();
catch(SQLException ex) {
System.err.println("SQLException: " + ex.getMessage());
public Demo(){
super("Demo Test Frame");
setSize(350, 200);
comboBox = new JComboBox();
comboBox.addItem("jdbc:odbc:VideoLibrary");
qtm = new QueryTableModel();
JTable table = new JTable(qtm);
JScrollPane scrollpane = new JScrollPane(table);
JPanel p1 = new JPanel();
p1.setLayout(new GridLayout(3, 2));
p1.add(comboBox);
p1.add(new JLabel("Enter your query: "));
p1.add(queryField = new JTextField());
p1.add(new JLabel("Click here to send: "));
JButton jb = new JButton("Search");
jb.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
qtm.setHostURL();
qtm.setQuery(queryField.getText().trim());
p1.add(jb);
getContentPane().add(p1, BorderLayout.NORTH);
getContentPane().add(scrollpane, BorderLayout.CENTER);
import java.sql.*;
import java.io.*;
import java.util.Vector;
import javax.swing.*;
import javax.swing.table.*;
public class QueryTableModel extends AbstractTableModel{
Vector cache;
int colCount;
String[] headers;
Connection db;
Statement statement;
String currentURL;
public QueryTableModel(){
cache=new Vector();
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
catch(Exception e){
System.out.println("problem loading the driver ");
public String getColumnName(int i){
return headers;
public int getColumnCount(){
return colCount;
public int getRowCount(){
return cache.size();
public Object getValueAt(int row, int col){
return ((String[])cache.elementAt(row))[col];
public void setHostURL(){
String url = "jdbc:odbc:VideoLibrary";
closeDB();
try{
db=DriverManager.getConnection(url,"","");
statement=db.createStatement();
catch(Exception e){
System.out.println("Could not initialize the database.");
e.printStackTrace();
public void setQuery(String q){
cache=new Vector();
String s="select * from Product";
try{
ResultSet rs=statement.executeQuery(q);
ResultSetMetaData meta=rs.getMetaData();
colCount=meta.getColumnCount();
headers=new String[colCount];
for(int h=1;h<=colCount;h++){
headers[h-1]=meta.getColumnName(h);
while(rs.next()){
String[] record=new String[colCount];
for(int i=0;i<colCount;i++){
record[i]=rs.getString(i+1);
cache.addElement(record);
fireTableChanged(null);
catch(Exception e){
cache=new Vector();
e.printStackTrace();
public void initDB(String url){
try{
db=DriverManager.getConnection(url);
statement=db.createStatement();
catch(Exception e){
System.out.println("Could not initialize the database.");
e.printStackTrace();
public void closeDB(){
try{
if(statement!=null){
statement.close();
if(db!=null){
db.close();
catch(Exception e){
System.out.println("Could not close the current connection.");
e.printStackTrace(); -
I have an ipad2. When connected to my wifi at home it will not download you tube videos for easy viewing. Do I need to upgrade my connection speed? Would 3 Mbps be enought or do I need to go to 6 Mbps. I mainly use my ipad to view emails, browse the internet and watch you tube videos.
thanks - MichelleWelcome to Apple Support Communities.
There are a number of factors in the 'speed' equation. Any or all of them can affect the 'observed' speed of your connection.
1. Are you in a neighborhood full of WiFi routers (and thus, lots of WiFi interference)? I can 'see' at least 22 other WiFi routers from my living room!
2. What is the maximum connect speed and band and bandwidth available from your wireless router. Is it 802.11n or the older 802.11a/b/g? 300Mbits or 150Mbits? 2.4Ghz or 5Ghz or both? Does your router measure (QoS) Quality of Service and can it change 'channels' automatically?
3. What is the observed strength of your wireless connection? Are you getting at least 80% signal when connected? Are there other people in your family also using significant bandwidth at the same time (Netflix, streaming video, streaming audio, game systems)
4. What is the "advertised" speed of your current ISP connection?
5. What is the measured throughput of your current setup. Go to speedtest.net or use the free speedtest.net app available in the App Store. Try several times, from different locations in your home, and at different times of day and night.
I have AT&T DSL advertised at 3Mbit/sec down and 512Kbit/sec up. My Speedtest.net measured throughput is about 2.4 Mbit/sec downstream and upstream is about 0.4Mbit/sec. I'm using a Motorola Netopia 2210-2 DSL modem. I have no problem viewing YouTube videos and other mobile video content on the iPad 2. I'm connected wirelessly to a D-Link DIR-655 Gigabit router rated at 150Mbps at 2.4Ghz (only) with 802.11 b/g/n enabled. The interior of my home is within a range of 30-50 feet from the router and no more than 1 wall. It is a single level concrete slab foundation of about 1500 sq. ft. with cathedral ceilings. I have successfully streamed ESPN3.com on my MacBook at the same time my son was streaming another ESPN3.com game on his MacBook Pro. I've streamed YouTube videos while my son was watching a NetFlix movie on his Wii game system. He's also successfully used Skype for extended 'teleconferences.' None of my devices are connected to HDMI on a large screen TV. 95% of the time, I can do iChat video without any signal breakup to my son (who is at a college with a Gigabit (1000Mbit) wired connection!). 5% of the time the connection drops. We haven't tried FaceTime (designed for mobile connections to be much less bandwidth-intensive, from what I understand) simply because we both have iChat on our computers.
So for me, a 3Mbit DSL connection is absolutely adequate, given all the other parameters mentioned. As the car manufacturers say, "Your mileage may vary."
Message was edited by: kostby -
Saved Objects are not displayed in designer view after insert
Hi All,
My HFRS is acting weird today. I tried to insert a saved Object(text,Image) into my report. I have inserted them by (Insert>>Saved Object) but I'm unable to view them in designer view after insert. When I run the PDF Preview I'm able to see the objects on the report. Any assistance? I want to move the text object to the bottom of the report.
Thanks.Resolved it.
-
Which factors affect the working speed of a distributed ID/IC workflow?
Hi all,
we have a pretty complicated structure for our different departments that have to work on print documents:
Multimedia department in location A that sets up the layout/assignments in InDesign --> has a local server where it can store everything for fast local access.
Multimedia department in location B that also sometimes sets up layouts/assignments and stores them on their local server.
Editing department in location B that accesses the assignments stored in location A and location B
The connection between location A and B is a 4 Mbit permanent link (SDSL, meaning both ways are 4 Mbit).
Latency is about 25ms, which is pretty good. Distance about 400km.
Server is a Windows Server with shares.
What would be the best way to ensure that the editing department gets the best possible speed while making sure that the multimedia department (especially location A) still has good speed, too?
Lately the editors have been complaining that working in the incopy files is rather slow. It takes minutes to open files and seconds for the cursor to appear when clicking into a text block.
Is there anything we can do? Moving the whole Project to location B would mean that the designers have to open the entire layout over the network connection - we tried that and it was even slower.
I always thought that once checked out the story would be cached locally and only saved back to the remote server when checking back in? I don't get it why the location has so much influence on the working speed in that case...
The bandwidth shouldn't be the problem, too since there isn't much going on on our network most of the time.
Can anybody shed some light on this?
Typical document: 20-50 pages, not too many images (I'd guess about 1 per 2 or 3 pages), one assignment per chapter (resulting in 4-6 assignments overall), 2-4 text blocks per page.
Any hints and advice would be appreciated...
Best regards,
MikeMike, IC/ID is designed for concurrent access on a *local* file server. It doesn't do well at all via VPN or long distance networks, in my experience. (Your times sound pretty speedy to me, actually.) The "caching of local files" only applies to Version Cue. That's not how InCopy/InDesign work on their own.
That is the reason for the remote workflow feature ("Package for InCopy.") The designers in Location A would create InCopy packages for the editors in Location B. The editors in Location B open the packages on their local computers in InCopy, edit them, then choose Return for InDesign (or Forward for InCopy if another editor needs to work on it). All the packages are sent as attachements to email or downloaded from the server.
The designers in Location B would continue to put their projects on the local server, and the editors in Location B would continue to work directly off that server for those projects.
If the remote (packages) workflow is not workable for you; you might consider a cloud computing sort of solution. I've had a great experience using both Window's LiveSynch and/or the service called Dropbox (getdropbox.com); both are free and both are biplatform. Everyone gets to work locally but the files are synched via the cloud automatically in the background, including the lock files.
AM -
Does the ACR histogram reflect the full image?
I am trying to streamline camera raw file preperation into a 3rd party color corrector.
When I take a raw and zero out all the settings, how come things can still be clipped out?
Isn't everything that is captured ---therefore in the histogram?
How do I linearize the files? And shouldn't they come out dark? Thats my experience with linear files from high speed video cameras.
Ideally I would like 16bit tiffs reflecting the sensor capture.
But I don't have all day to manually customize every setup on ..say 100 cr2's?
Any tips would be most appreciated.
thanks,
Tomssprengel wrote:
Is there a way to get the non-demosaicked data as a TIF, the one-color-per-pixel numbers? Then you could see the original RAW numbers and understand if any of the photosites were maxed out.
If your camera is supported, the easiest way to view raw files is Photobola Rawnalyze. It has many options, but the easiest is the histogram as shown below. This is from the Nikon D3 with full ETTR of a Stouffer wedge. Note that no white balance is applied and the green channel is just short of clipping.
Another way to analyze the image is with a program such Iris (astronomical freeware) that can look directly at raw files. Here is the green1 channel of the same file with the histogram shown by another freeware program (ImageJ from the National Institutes of Health). In a raw file, clipping can occur when the sensor saturates or the ADC overflows. Because of shot noise and pixel response nonuniformity, the histogram is bell shaped and some clipping can begin when the right edge of the bell curve begins to clip and clipping will be complete when the left edge of the bell curve reaches clipping.
In practice, ACR with a linear tone curve and the proper exposure offset is accurate enough for most purposes. However, its output is white balanced and the red and blue channels can appear clipped from the white balance multipliers when the raw data in those channels are actually intact. Here there is slight clipping with the exposure offset of -0.5 EV, but it can be totally eliminated by using an exposure of -0.55 EV. -
Bought 4th Gen 3TB TC - streaming TV over the internet is now so slow and now is constantly buffering. It seems the Airport Utility is always 'searching for new networks' - don't know if this is the problem. It's not the internet speed as checked that. I took my old router upstairs and was streaming TV via my ipad seamlessly - the same program via the TC was constantly buffering.
I just expected to be able to plug in the TC, so a simple set-up and experience wireless both upstairs and downstairs in my house. For some reason the range is low and speed veru disappointing.
I am far from being an IT expert but I would welcome advice about setting up this TC so we can enjoy the product as it was designed. Please HELP!No silver bullet........but my suggestions may drive you in the right direction.
1. Unplug the power cable from the TC and wait 10-15 minutes before powering back up. Seriously wait!
Proceed to #2 if this dosen't help.
2. Unplug the power cable from the TC, ubplug the power cable from your Broadband Modem (assuming it's a cable modem), disconnect ethernet, and cable from modem.
2a. Wait 10-15 minutes then re-connect cable, ethernet, and power back to modem (your modem should power up unless you have a power switch) wait for all the modem lights to come on EXCEPT activity.
2b. Connect ethernet from modem to TC, and plug in the power cable to TC.
Proceed to #3 if this dosen't help.
3. Reconfigure the TC.........Read here........http://support.apple.com/kb/HT3728
All really simple to do....if you need additional help let me (us) know. -
Why the LMS topology Service takes long time to reflect the device availability status?
In the topology services map, the color status of the router takes long time to move from red to green and vice versa.
i have already configured the time interval in the fault monitor poller setting to 6minutes but the only thing reflected the little mark at the top of the icon itself. anyhow the topology service still believe that the devices are unreachable. i have waited almost 45 minutes and nothing happened.
please let me known the trick to make the topology services act more quicker .
Sent from Cisco Technical Support iPhone AppTopology Services isn't really designed to be a near real time network device up/down tool. It will an change icon's status as a result an ANI engine polling cycle or an admin operator-initiated manual device rediscovery. While you can increase the frequency of polling cycles, that's not usually such a good idea as you could make the server be polling constantly and never completing a job.
To ascertain near real time fault status one should refer to the Fault Dashboard. -
Stange behaviour in the inserts.
Hello
I have trying to insert a data into sql server.
I use this code:
var db;
var rd;
db = xfa.sourceSet.cd;
rd = xfa.record.cd;
var sql = 'insert into t1 (text) values(\'t1\');'
console.println(sql);
db.resolveNode("#command").query.select.value = sql;
db.open();
And the sql of my data connection is "select * from t1".
the I execute this I obtain this error "it isn't literal, this is my translation" GeneralError: Error in the operation.
XFAObject.open:8:XFA:myform[0].#subform[0].button[0]:click
Operation failure of ado2xfa. It can't find the element of the collection that correspond with the name or the ordinal asked.
If I change the sql for "select * from t1 insert into t1 (text) values(\'t1\');" this works, but I don't want to use this because, this worls in sql server but not works in oracle, that is the real platform.
It seems that designer hope receive a value of the select and with the insert doesn't receive data.
Thanks a lot for your help
Hosting Association
The low cost quality hosting
http://www.hostingassociation.bizHello
I have fixed the problem. But with this solution I don't know if the insert has been executed correctly. someone know how fix it?
The solution is use try and catch, and ignore the errors.
try{
var db;
var rd;
db = xfa.sourceSet.cd;
rd = xfa.record.cd;
var sql = 'insert into t1 (text) values(\'t1\');'
console.println(sql);
db.resolveNode("#command").query.select.value = sql;
db.open();
}catch(e) -
Why Java Platarform Micro Edition 3.0 doesn't reflect the reality ?
Hi guys,
It's my first ME project and I would like to know why into version 3.0 of ME, don't have the necessity of create your access (read and write into files) methods using Threads, and in 2.5.2 I must have to use Threads ? Because my project runs smooth into 3.0 but not into my mobile (E63) and 2.5.2 emulator, after reading plenty docs, and change the emulator to 2.5.2 I did discover that have the need of using Threads. What is the right one and why the 3.0 doesn't reflect the reality ?
There are any way that my project made with 3.0 runs smooth, how ?
Thank you in advance.Hi once again,
One example of what I'm doing, using the javax.microedition.io.file.FileConnection to save and read my files, though it only works into my 3.0 emulator.
I'm using this method to open and read the file.
private String loadCipher(String typedKey, String pathLoad, String fileName) throws DigestException {
StringBuffer notFormattedText = new StringBuffer();
pathLoad = pathLoad + fileName;
FileConnection fc = null;
InputStream is = null;
try {
fc = (FileConnection) Connector.open(pathLoad);
is = fc.openInputStream();
int ch = 0;
for (int i = 0; i < fc.fileSize(); i++) {
if ((ch = is.read()) != -1) {
notFormattedText.append((char) ch);
is.close();
fc.close();
} catch (IOException ioe) {
System.out.print("Error reading!"); // Here I'll have to deal with exceptions
System.out.print("IOException : " + ioe.getMessage());
} catch (SecurityException se) {
System.out.print("Error security!"); // Here I'll have to deal with exceptions
System.out.print("Securuty exception : " + se.getMessage());
pathLoad = FILE_ROOT;
String myFileText = notFormattedText.toString();
byte[] keyFromFile = readKey(typedKey, myFileText.getBytes()); // Here is where the program goes and decript my file
return new String(keyFromFile); // Here I return the decripted text to be compared with password or for that the user might read it.
}I don't intend to use Thread to run it, although I'm afraid of that it's the only way and with this all program structure will have to be re-designed.
Anyone knows if Thread is needed just to use the javax.crypto.... and javax.security..... ? Because I'm lost.
Thank you in advanced -
Cannot find "Structure" menu under the Insert tab. Need it to insert a header
I just downloaded a trial version of DW CS6 and am following the on-line tutorial, but cannot find the "Structure" option under the "Insert" tab when creating an HTML document. Where di it go?
I think the confusion here is you appear to be following along some resource for DWCC while using DWCS6.
There are many changes between DWCS6 and DWCC. Actually, there are quite a few changes between DWCS6 Disk version and DWCS6 Cloud version with even more between both of those and DWCC (and now DWCC 2014).
With the speed that Adobe applications are changing with the Creative Cloud delivery system, you really must make sure you are using the correct resource version for your program version. -
Record insert speed! help me
I use SQLServer 2000.In order to increase insert speed,I use batch method.But the result is too bad.
Only 2000 records are inserted at one min.I think I use batch in a wrong way,anyone could give me a sample about it?The refrence is welcome.Thank you.
By the way,how many records could be inserted in one min.
Thanks for reading.Insert speed is dictated by:
- Network speed
- If the database must reparse the SQL for each insert statement
- If the inserting is logged or not
- If there are triggers and constraints in the tables affected by the insert
- If there are a lot of indexes in the tables affected by the insert.
If you really need to insert a lot of lines in a batch, use bcp or DTS.
The executeBatch methods (JDBC 3.0) alleviate the influence of the two first factors (network speed and reparsing SQL statements). The other factors can not be reduced using pure JDBC.
Maybe you are looking for
-
ITunes error in Windows (Vista)
I am constantly getting the following error: "The itunes library file cannot be saved. An unknown error occurred (-48)." I am running on a Vista Ultimate machine connected to a small business server. My library is stored on a redirected My Documents
-
Somehow I changed the resolution setting for the display on my MacBook. Now I'm not sure what to set it. I currently have it on 1280 X 800, but I'm not sure that is right. Any help will be appreciated.
-
Updated Table Name Changes Applescript Operation in Numbers 3.5
I've been using Applescript in Numbers for some time to copy/paste data (set cell values) from one sheet table to another sheet table. My original script was heavily cribbed from something Yvan Koenig had posted 2-3 years ago. I recently updated to Y
-
Blue background under finder icon in dock
Hi guys, i have this problem (as you can see on screen shot - blue background under finder icon in dock), what i need to do to fix it?
-
I have a 3 node Hyper-V cluster (hosts are Windows Server 2012 R1) managed by VMM 2012 R2. Is there any way to give specific users possibility to connect to console of specific VMs? From within VMM console, Hyper-V console, Failover Clustering consol