Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-22-2010, 01:53 PM
javastuden's Avatar
Member
 
Join Date: Nov 2009
Posts: 73
Rep Power: 0
javastuden is on a distinguished road
Default is the any special issue regarding the insertion in msacess 2007
Hi all
Is there any special feature to be keep in mind when iserting data to msacess 2007

my problem regarding the insertion executeUpdate is getting op as 1 but when i open the databse's tabel the value i entered progrmicaly is not there

if the same pgm if i put the query to select then the output will be correct

is the any special issue regarding the insertion in msacess 2007


Thank You
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-22-2010, 02:17 PM
Senior Member
 
Join Date: Jun 2008
Posts: 1,375
Rep Power: 3
masijade is on a distinguished road
Default
Are you closing the statement and connection before checking whether the record is there. With MS Access you must close at least the statement, if not also the connection, before the changes take effect.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-25-2010, 04:41 AM
javastuden's Avatar
Member
 
Join Date: Nov 2009
Posts: 73
Rep Power: 0
javastuden is on a distinguished road
Default how the password set in url
thanks for the reply

i got by bug correcected i didn't close the connection so the problem arise.

in ms acess2007 i set password as opened with open exclusively option and set a password 123456
my config file is

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Config{
public Connection con=null;
public Config(){
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//String filename = "D://database//Man.mdb";
String filename = "E://sss.mdb";
String database = "jdbcdbcriver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}";
con = DriverManager.getConnection( database ,"","");

/* Class.forName("com.mysql.jdbc.Driver").newInstance ();
con=DriverManager.getConnection("jdbc:mysql://localhost/test?user=root&password=root");*/

}catch(Exception ex){
System.out.println("exception in com.manasa.config-------"+ex);
}


}

}

how the password is set in the url

thank in advence
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 01-25-2010, 08:18 AM
Senior Member
 
Join Date: Jun 2008
Posts: 1,375
Rep Power: 3
masijade is on a distinguished road
Default
Use the three argument version of getConnection. See the API docs. But, in any case, doesn't that "password=" tell you anything? And, BTW, that is not a config file.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
XML with special characters Kaizah XML 1 11-06-2009 03:26 PM
Regarding Data Insertion adeeb Database 1 06-22-2008 06:26 AM
Using PreparedStatement for insertion Java Tip Java Tips 0 02-06-2008 10:30 AM
database insertion abhiN New To Java 0 01-17-2008 08:24 AM
special characters ravian New To Java 2 11-16-2007 02:28 PM


All times are GMT +2. The time now is 09:46 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org