Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners How to Store Float Value into Access Database
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


shweta
How to Store Float Value into Access Database
1 Answer(s)      4 years and 7 months ago
Posted in : Java Beginners


Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store it.

Advertisement
View Answers

April 12, 2010 at 3:52 PM


Hi Friend,

You can use double data type in place of float. To store the double value in Access database, you need to set the datatype 'Number' to both the fields and change the Field Size of both the fields to 'double' from Field Properties.

Here is an example:

import java.sql.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class Test extends JFrame{
public static void main(String[]args){

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con1 =DriverManager.getConnection("jdbc:odbc:access","","");
Statement stmt=con1.createStatement();
double marks=80.58;
double percent=80.58;
int i=stmt.executeUpdate("insert into student(marks,percentage) values("+marks+","+percent+")");
JOptionPane.showMessageDialog(null,"Data is successfully inserted into database.");
con1.close();
}
catch(Exception e){
System.out.println(e);
}
}
}

Thanks


Related Tutorials/Questions & Answers:
How to Store Float Value into Access Database - Java Beginners
How to Store Float Value into Access Database  Hello sir,I want to Store Student Marks Percentage into Access Database in Float Value how i can Store.... To store the double value in Access database, you need to set the datatype
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
Advertisements
how to delete the access database value in jsp
how to delete the access database value in jsp  i loaded my database data into the dropdown list box...now i want to delete the value..plz send the source code to delete the value in dropdown list box and also from database
How to store JComboBox selected Item into Ms Access Database - Java Beginners
How to store JComboBox selected Item into Ms Access Database  How to store JComboBox selected Item into Ms Access Database.  Hi Friend...:access","",""); Statement stmt=con.createStatement(); ResultSet rs
how to store image file and videofile in ms access database using java? - JDBC
how to store image file and videofile in ms access database using java?  how to store image file and video file in ms access database using java
store dynamic generated textbox value into database
store dynamic generated textbox value into database  sir, how do i store dynamically generated textbox value into the database thanks in advance
How to store image into database
How to store image into database  Hi, all I want to store image into database using Java. Can anyone help me that how can i store image into database... through the following link How To Store Image Into MySQL Using Java
How to store an image in database
How to store an image in database  Hi........... How to store an image in postgresql using a query. I mean tell me the way to store an image using datatype. I am using the datatype bytea but tell me how to insert the image
code for insert the value from jsp to access database
code for insert the value from jsp to access database  code for insert the value from jsp to access database
Write a float value into float buffer at given index.
Write a float value into float buffer at given index.  In this tutorial, we will see how to write the given float value into float buffer at the ...(..) method write the given float value into associated buffer at given index
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
how to store jtable value in multidimensional array?
how to store jtable value in multidimensional array?   i want to store the value of jtable in multidimensional array,with type double. how to store jtable value in multidimensional array
how to retrieve the id value itself from the access database to drop down listbox in jsp
how to retrieve the id value itself from the access database to drop down listbox in jsp  how to retrieves the id which is an int datatype, from access database to drop down list box in jsp...plz send the code for that.....plz
how to access database in applet
how to access database in applet  HI... I'm having an applet where we should display the database values in the applet... It works fine in the local system(same network)... but when its in the server, we r getting null values
How to store JComboBox item into database
How to store JComboBox item into database   import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.DefaultComboBoxModel; import javax.swing.JComboBox; import
how to access the MS ACCESS database with java
how to access the MS ACCESS database with java   how to access the MS ACCESS database with java how can we insert,delete,update,search records of ms access with java   Java MS Access database connectivity Follow
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row
how to read the values for text and csv files and store those values into database in multiple rows..means one value for one row  Hai, I need... or .txt) file and get the values from that file and store them into database
how to store and then immediately retrieve when store the image into database?
how to store and then immediately retrieve when store the image into database?  how to store and then immediately retrieve when store the image into database?   Here is a jsp code that insert and retrieve image from
Problem with Double type Value in Access Database - Java Beginners
Problem with Double type Value in Access Database  Hello sir I have store Double Type Value in MS Access Databse,but when I search Record then it Gives Round Figure Value related with Percentage and I want to Store and Retrieve
how to access the MS ACCESS database with java - Java Beginners
how to access the MS ACCESS database with java  how can we insert,delete,update,search records of ms access with java
how to store and retrieve image from database
how to store and retrieve image from database  how to store and retrieve images into database(oracle) and how to retrive images from database using... database. <%@page import="java.sql.*,java.io.*"%> <% try{ InputStream
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
how to store image upload path to mssql database
how to store image upload path to mssql database  hi there!!, i need help in storing the image upload path into the database. basically i just use file select to upload the image from jsp to database. however when i click submit
How to access (MySQL)database from J2ME?
How to access (MySQL)database from J2ME?  I am new to J2ME. I am using NetBeans. Can anyone help me? How to access (MySQL)database from J2ME? ( I search a lot I found that there is need to access database through servlet
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example
How to store extracted values from xml in a database? - XML
How to store extracted values from xml in a database?  I want to store extracted xml values in a database... How can i store extacted xml values in a database... give me a example
How to store two integer value in a separate file and retrieve those values
How to store two integer value in a separate file and retrieve those.... But Don't have any idea how can i do that. Like what format of file i need, or how can i write and update value in that file
how can i store text box values as it is in database table
how can i store text box values as it is in database table  CUSTOMER DESCRIPTION
how to connect to MS access database in JSP?
how to connect to MS access database in JSP?  how to connect to MS access database in JSP? Any seetings/drivers need to be set or installed before... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting the driver
Advertisements
 

 

 

DMCA.com