How to Store Float Value into Access Database

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 it.
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
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
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 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
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 ...) The put(..) method write the given float value into associated buffer
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
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
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 database from JSP?
How to access the database from JSP?  Hi, What is the process... database from JSP which explains you how to access the database by embedding... you can access the database by embedding the JDBC code. But this is not the best
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 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 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 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 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 (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 and retrieve image from database in JSP?
How to store and retrieve image from database in JSP?  Hi, In one of my application I have to store and then display the image in JSP. How to store and retrieve image from database in JSP? Thanks   HI, You can use
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
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
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 Connect MS ACCESS 2003 Database in C Program with Graphics.
How To Connect MS ACCESS 2003 Database in C Program with Graphics.  How To Connect MS ACCESS 2003 Database in C Program with Graphics
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
add text box and select list dynamically and get its value to store it into database using jsp request parameter
add text box and select list dynamically and get its value to store it into database using jsp request parameter  its very helpful when you have only dynamically added text field but want code to retrive value of dynamically
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
how to select the row value that was retrived from the database ?
how to select the row value that was retrived from the database ?  I am getting the data's from the table that was stored in database. Now in the page in which i am getting all the data from the database has an another select
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 store values in a database using JSTL? - JSP-Servlet
How to store values in a database using JSTL?  I want to store values in a database... How can i store in database? Here is my code... This wil... in a database...How can i do? Airport
How to access session value using OGNL.
How to access session value using OGNL. In this example, you will see how to access value of session using OGNL expression language in struts2.  ...;body> <a href="sessionOGNL">Access_Value_bean_from_session
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 to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  how to insert check box value to the database using jsp my code is <link href..." name="pmanager" value="Enter" ></td> <td align
how to store and retrieve images int and from the database using php
how to store and retrieve images int and from the database using php  please anyone can help me in storing the images and retrieve it back from the Mysql database using php
Connect database in Access to Netbean?
Connect database in Access to Netbean?  how to connect database in micrsoft access to Netbean?i know it can be connected by using JDBC-ODBC bridge, can i know the steps in connecting the database? Is there any source code
how to store JTree data hierarchically in mysql database from netbeans
how to store JTree data hierarchically in mysql database from netbeans  how to store JTree data hierarchically in mysql database from netbeans. I am new to this topics so I need a program and tables you are using in database
How to read excel data and store it in database - Java Beginners
How to read excel data and store it in database  Hi, I want a java code to read data from excel and store it in Ms Access database.I tried the code but but its printing the output in console.I dont know how to store the excel
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert check box value to the oracle database using jsp? I want to create hotel's...; <td><input name="pack_id" type="type" value
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
how to insert checkbox value into database using jsp
how to insert checkbox value into database using jsp  How to insert check box value to the oracle database using jsp? I want to create hotel's...; <td><input name="pack_id" type="type" value="<%= pack_id %>" size
How I Upload File and Store that file name in Database using JSP
How I Upload File and Store that file name in Database using JSP  Hi All, I m the beginner in JSP and I want to upload the file and store that file and some other form data in MySQL database. Ex. There is one employee detail
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page
how to set a value of dynamic number of drop down lists on a jsp page and access it value on another jsp page  actually i have to create dynamic... ,rating2......number of buks in that category(and each drop down list has value
How to Open Picture From M.S. Access Database using Java Servlet ?
How to Open Picture From M.S. Access Database using Java Servlet ?  Hi all my Friends I have below code which insert a picture into M.S. Access Database But i m still not able to open this picture through Java using M.S. Access

Ads