Home Answers Viewqa JDBC audio files in jdbc connectivity with ms-access

 
 


ravneet
audio files in jdbc connectivity with ms-access
1 Answer(s)      2 years and 10 months ago
Posted in : JDBC

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 Pages:
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
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 - 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
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
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
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, *.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
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
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
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
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
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 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
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
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
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
problem in jsp using ms-access
problem in jsp using ms-access  after starting server(tomcat) wen v...("jdbc:odbc:st") Can u pls help us in solving this pbm by giving whole source... and select the driver Microsoft Access Driver(*.mdb). 3)After selecting
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
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
applet connected to table in MS Access database
applet connected to table in MS Access database   i have connected my java code with the MS access database and this is my code, can anyone tell me...:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=faltu.mdb"; // String url = "jdbc
java to MS Access conectivity - Swing AWT
java to MS Access conectivity  give me source code to stored...("sun.jdbc.odbc.JdbcOdbcDriver"); Connection connect =DriverManager.getConnection("jdbc:odbc:access... database on the ACCESS.  Hi Friend, Follow these steps: 1. Open
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... implementations for each database. For example to access oracle database we need the JDBC
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
updation problem during transaction to ms-access
updation problem during transaction to ms-access  Hey friends I am a beginner to java,and my problem is related to updation query in ms..."); Connection con = DriverManager.getConnection("jdbc:odbc:student
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
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
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
how to connect java with ms access using odbc in eclipse
how to connect java with ms access using odbc in eclipse  import..."); //Connection con = DriverManager.getConnection("jdbc:odbc:DRIVER={Microsoft Access Driver (*.accdb)};DBQ=student.accdb","",""); Connection con
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... =DriverManager.getConnection("jdbc:odbc:access","",""); Statement stmt=con.createStatement
ms access
ms access  how to delete the autonumber from ms access using java delete code
How To Display MS Access Table into Swing JTable - Java Beginners
How To Display MS Access Table into Swing JTable  How to Display Records From MS Access Database To JTable. Plz Help Me  Hi Friend... = DriverManager.getConnection("jdbc:odbc:access"); String sql = "Select * from
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
connectivity
connectivity  sir i have created a web page for login form and i have also created the related data base in both ms access and oracle 10g now how to store those values in form to databases can u plz hlp me
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
JTABLE IS NOT RETIVING DATE FROM MS ACCESS........PLEZ PLEZ PLEZ HELP!!!!!!
("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con = DriverManager.getConnection("jdbc:odbc:access"); String...JTABLE IS NOT RETIVING DATE FROM MS ACCESS   PLEZ help me to retrive date from access to jtable....... import java.awt.BorderLayout; import
Want to access my Ms-access Db file which is placed inside the same Jar file
Want to access my Ms-access Db file which is placed inside the same Jar file  how do i access my Ms-Access file placed in the same jar file where my... or is their any alter-native?? Do i need any Driver to do this ... i m able to access a Ms
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
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
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
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.