audio files in jdbc connectivity with ms-access

audio files in jdbc connectivity with ms-access

i need to know how to retrieve audio files through jdbc connectivity with ms-access and how to play them through link in browser....
View Answers

July 17, 2010 at 4:25 PM

Hi Friend,

Try the following code:

import java.io.*;
import java.sql.*;
class AccessDatabase{
public static void main(String[] args) {
try{
String url="jdbc:odbc:access";

File file=new File("c:\\tuner5.wav");
FileInputStream in=new FileInputStream(file);

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:access");
PreparedStatement ps = con.prepareStatement("INSERT INTO file(ID,fildata) VALUES(?,?)");
ps.setInt(1,6);
ps.setBinaryStream(2,in,(int)file.length());
ps.execute();
ps.close();
Statement stmt = con.createStatement();
ResultSet rs = stmt.executeQuery("SELECT fildata FROM file where ID=6");
if(rs.next())
{
InputStream fis1;
FileOutputStream fos;

fis1 = rs.getBinaryStream("image");
fos = new FileOutputStream(new File("access.wav"));
int c;
while ((c = fis1.read()) != -1){
fos.write(c);
}
fis1.close();
fos.close();
}
System.out.println("Retrieved successfully");
rs.close();
stmt.close();
con.close();
}
catch(Exception e){
System.out.println(e);
}
}
}

Please visit the following link:

http://www.roseindia.net/java/example/java/applet/PlaySoundApplet.shtml

Hope that it will be helpful for you.
Thanks









Related Tutorials/Questions & Answers:
audio files in jdbc connectivity with ms-access - JDBC
audio files in jdbc connectivity with ms-access  i need to know how to retrieve audio files through jdbc connectivity with ms-access and how to play... static void main(String[] args) { try{ String url="jdbc:odbc:access"; File
J2ME connectivity to ms access
J2ME connectivity to ms access  How to establish client server connectivity to access ms access database on the server side? I have made the odbc connection. Plz help me in the coding part.. Dont know how to start
Advertisements
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
Jdbc MS-Access question
Jdbc MS-Access question  How to delete records from the three table in MS-Access? They are in relationship with each other regarding to data field
MS Access - JDBC
= stmt.executeQuery(query); Code to help in Connectivity in MS Access : import... information about MS access database...but still i am having doubt in that topic. My problem is : Is there any jar to connect MS Access and java ... because
MS Access` - JDBC
MS Access`  Hello Sir, Thank you very much for your valuable information. Actually i am doin a project to generate Hall tickets.So, I need to insert image into MS Access Database. Now the task is how to retrieve the image
java &ms access - JDBC
for a food festival using Java swing as front end and MS access as Backend... ve managed to populate the JComboBox using MS Access. The problem is only 8 per... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
jdbc warning regarding to ms access
jdbc warning regarding to ms access  shows warning msg while compiling using ms access : warning: sun.jdbc.odbc.JdbcOdbcDriver is Sun proprietary API...=DriverManager.getConnection("jdbc:odbc:accdsn","",""); try{ Statement stmt
MS ACCESS - JDBC
MS ACCESS  java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'origin='src' destination='dest''. THAT MY PROBLEM
ms access
ms access  how to delete the autonumber from ms access using java delete code
JDBC, Java Database Connectivity
tutorials. Java Database Connectivity or JDBC for short is Java bases API... Server, MS Access etc. It gives necessary tools to make a connection... Connectivity or JDBC for short is a standard API in Java for accessing
MS access
MS access  how do i access my Ms-Access file placed in the same jar file where my application code/class file r present??? Want to access it via Code. Can anyone help me ? Please give reply urgent...   give me reply
Ms Access
Ms Access   How to get query for Primary key from MsAccess?   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE WHERE table_name = 'data';   SELECT column_name FROM INFORMATION_SCHEMA.KEY_COLUMN
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
MS Access - JSP-Servlet
in Connectivity in MS Access : import java.sql.*; public class... stepts 1.to configure the ms access database to your system control panel...MS Access  hello sir, i want to use MS.Access as my database..so my
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
ms access
has to login . i already created ms access page and inserted values throught... and password" from my ms access............and detail in register(table in my ms... and password " he has to login . i already created ms access page and inserted values
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.
online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.  please provide online quiz program coding using jsp, jdbc odbc connection with ms. access.. Thank you.   Create table test
MS-Access
MS-Access  I am trying to upload a image to ms-acess using jsp,and my...: [Microsoft][ODBC Microsoft Access Driver]COUNT field incorrect ".I think i set... = DriverManager.getConnection("jdbc:odbc:student"); File imgfile = new File("C:/rose.jpg
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb...MS ACCESS  i have done : Insert form data into MS database...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb...MS ACCESS  i have done : Insert form data into MS database...-> data sources. 2)Click Add button and select the driver Microsoft Access
MS ACCESS
= DriverManager.getConnection("jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb...MS ACCESS  i have done : Insert form data into MS database Follow...-> data sources. 2)Click Add button and select the driver Microsoft Access
How to Access MS Access in jar.
to access it via Code or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms-access via JDBC but cant find the file wen...How to Access MS Access in jar.  how do i access my Ms-Access file
inserting picture in ms access
inserting picture in ms access  hi i am sanatan, how to insert picture in ms access by jsp.   <%@page import="java.sql.*,java.io.*"%>..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
JDBC Connectivity - JDBC
JDBC Connectivity  my question is how to connect a Java program with MS-Access database?  Hello Use this code import java.sql...."); // set this to a MS Access DB you have on your machine
MS Access` - IDE Questions
MS Access`  hello sir, how to configure MS Access database in Net Beans5.5... and i have a doubt, where should we run the below code...either in IDE or in any editor like EDITPLUS. waitin for your reply.... thank you
JDBC CONNECTIVITY
file in environment variable.   Java Mysql connectivity Other JDBC...JDBC CONNECTIVITY  How do i connect my database to java. I have the connector file and i place it in lib of jdk folder and installed the jdbc driver
link hibernate to MS ACCESS database
link hibernate to MS ACCESS database  how to link hibernate to ms access database instead of sql database
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi
excel to ms access
excel to ms access  hello sir i am developing a application which requires extracting data from excel sheet and place in the ms access database using java programming for example: in excel sheet i have 2 columns and more than
connectivity - JDBC
connectivity  How can we connect sql server using Java   Hi Friend, By using JDBC drivers, you can connect SQL server with java. Please visit the following link: http://www.roseindia.net/jdbc/jdbc.shtml
jdbc connectivity
jdbc connectivity  import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.*; public class NewJFramefin extends...=e.getActionCommand(); String check; String str="jdbc:odbc:dsn1
connectivity - JDBC
driver for JDBC and set in the Tomcat/lib folder and if any more problem give full..., Please check the jar file for Connection driver for JDBC and set in the Tomcat
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 use JTable with MS-Access
(MS-Access). 1. Name 2. City 3. Contact I want to Display....   Here is an example that retrieves the data from MS Access database... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from data"; Statement
How to use JTable with MS-Access
(MS-Access). 1. Name 2. City 3. Contact I want to Display....   Here is an example that retrieves the data from MS Access database... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from data"; Statement
jdbc connectivity to mysql tutorial
jdbc connectivity to mysql tutorial  here is complete jdbc connectivity to mysql tutorial for newbies. Person who don't even know how to install mysql and don't know about which driver to use can do with ease
Migrating from mysql to MS Access
Migrating from mysql to MS Access  Hi I am hoping for some help I need to write a conversion program (SQL statements) to import existing data in a MYSQL database to a MS Access database. any suggestions would be appreciated
MS-ACCESS Query Problem - SQL
MS-ACCESS Query Problem  hi sir i have table which is initially have empty records Deleted Attributes: Roll Name Add Age Course Class... = DriverManager.getConnection("jdbc:odbc:access"); Statement st
JDBC CONNECTIVITY - JDBC
JDBC CONNECTIVITY  String jclass="sun.jdbc.odbc.JdbcOdbcDriver"; Class.forName(jclass); String dsn= "Jdbc:Odbc:Employee"; Connection con... = con.prepareStatement("insert into detail values(?,?,?,?)"); I am a bigner in Jdbc so please tell
how to insert values from jsp into ms access
how to insert values from jsp into ms access   how to insert values using jsp into ms access database
accessing ms access through jsp
accessing ms access through jsp  i have 3 tables in my database employee,project,task if i put employee id the search field .i should get details from other table what all queries should i use in servlet file and i am using
jdbc oracle connectivity problem
jdbc oracle connectivity problem  Hi All, I am trying to connect my swing application to oracle DB . but class.forname is giving error. Please suggest me if there is some different way to connect swing application to oracle
database connectivity - JDBC
connectivity programs with MSacces   Hi Friend, If you havn't create your... a user DSN 4. Select Microsoft Access Driver(*.mdb) 5. Select database name.... For programs,visit the following links: http://www.roseindia.net/jdbc/Jdbc-odbc
MS Access connct using flex with java
MS Access connct using flex with java  Hi All, Can anybody help me how to connect to the MS access database and getting the data using flex in java technology with tomcat server
Accessing Ms access data in JAVA GUI Envi.
Accessing Ms access data in JAVA GUI Envi.  Q.How to insert data into ms access data in java using swing ? Q.How to slove (access denided ("java.lang.RuntimePermission" "accessClassInPackage.sun.jdbc.odbc")" these exception
Eclipse Connectivity - JDBC
Eclipse Connectivity  Hello Friends.. I want to do connectivity... connectivity..and which plugins are required for it. i have try to do connectivity but i got given below error. "Error Occured Error
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am...; String url = "jdbc:mysql://localhost:3306/"; String dbName... the following link: http://www.roseindia.net/jdbc/jdbc-mysql

Ads