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



Home Answers Viewqa JDBC JDBC Connectivity
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


preeti
JDBC Connectivity
1 Answer(s)      6 years and a month ago
Posted in : JDBC



Advertisement
View Answers

September 10, 2008 at 12:29 PM


Hello

Use this code

import java.sql.*;
class Test


{
public static void main(String[] args)


{


try {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
// set this to a MS Access DB you have on your machine
String filename = "d:/java/mdbTEST.mdb";
String database = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=";
database+= filename.trim() + ";DriverID=22;READONLY=true}"; // add on to the end
// now we can get the connection from the DriverManager
Connection con = DriverManager.getConnection( database ,"","");
}



catch (Exception e) {
System.out.println("Error: " + e);
}

}

}

//save this code into a file called Test.java and compile it and run it

Thanks
Rajanikant


Related Tutorials/Questions & Answers:
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
JDBC CONNECTIVITY
connectivity Other JDBC Tutorials...JDBC CONNECTIVITY  import java.sql.Connection; import..."); con = DriverManager.getConnection("jdbc:mysql://localhost:3306/abhi
Advertisements
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
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
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.... String filename = "d:/java/mdbTEST.mdb"; String database = "jdbc
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
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.... For programs,visit the following links: http://www.roseindia.net/jdbc/Jdbc-odbc-connection.shtml http://www.roseindia.net/jdbc/Jdbc-odbc-connectivity.shtml Thanks
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
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
Connectivity with sql in detail - JDBC
Connectivity with sql in detail  Sir/Madam, I am unable to connect the sql with Java. Please tell me in detail that how to connect. Thankyou
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
jdbc connectivity through jsp
jdbc connectivity through jsp  my code: <%@ page language="java... = ""; String url = "jdbc:mysql://localhost/interviewer... at line 20 17: String url = "jdbc:mysql://localhost/interviewer"; 18
mysql jdbc connectivity
mysql jdbc connectivity  i want to connect retrieve data from mysql using jdbc
database connectivity in java - JDBC
database connectivity in java  import java.io.*; import java.awt.*; import javax.swing.*; import java.awt.event.*; import java.sql.*; class... con1; con1=DriverManager.getConnection("jdbc:odbc:Mycon
database connectivity - JDBC
."); Connection conn = null; String url = "jdbc:mysql://localhost:3306...(); } } } For more information on JDBC in java visit to : http://www.roseindia.net/jdbc
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
code to establish jdbc database connectivity in jsp
code to establish jdbc database connectivity in jsp  Dear sir, i'm in need of code and procedure to establish jdbc connectivity in jsp
Jdbc connectivity by type 4 driver
Jdbc connectivity by type 4 driver  I have done a code with database connectivity with driver 4,it copiles,but while running it is showing...=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521","system","123
regarding connectivity program only - JDBC
regarding connectivity program only  can u give me code regarding..., i am sending simple code of connectivity import java.sql.*; public... = "jdbc:mysql://192.168.10.211:3306/"; String db = "amar"; String driver
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
JDBC-Odbc Connectivity
JDBC-ODBC Connectivity       The code illustrates an example from JDBC-ODBC Connectivity. The code helps you in retrieve the name and size of the column
regarding connectivity program only - JDBC
regarding connectivity program only  can u give me code regarding .. that i had created student data base with his name and subject marks resp ... i use html in front end ...that there r options like 1.name---------- 2.sub1
Java vs Oracle Connectivity - JDBC
) Load and Register the JDBC driver:*********** DriverManager.registerDriver... = DriverManager.getConnection("jdbc:oracle:oci8: @oracle.world", "root", "root"); where... = DriverManager.getConnection ("jdbc:oracle:thin:@localhost:3306:roseindia", "root", "root
DataBase connectivity in java with Microsoft sql server2000 - JDBC
DataBase connectivity in java with Microsoft sql server2000  How i can achieve database connectivity with Microsoft sql server2000 in my java source code
JDBC Connectivity Code In Java
JDBC Connectivity Code In Java      ... in understanding JDBC Connectivity Code in Java. In this program, the code...;url = "jdbc:mysql://localhost:3306/";   
The required JDBC drivers to establish connectivity to my database part of the JDK.
The required JDBC drivers to establish connectivity to my database part of the JDK.  Are all the required JDBC drivers to establish connectivity to my database part of the JDK
JDBC - Java Database Connectivity Tutorial
JDBC - Java Database Connectivity Tutorials  ...; New Features in JDBC 4.0 Java database connectivity (JDBC) is the Java... rows. JDBC Tutorials JDBC (Java Database Connectivity
JDBC, Java Database Connectivity
tutorials. Java Database Connectivity or JDBC for short is Java bases API... driver as per your application needs. About JDBC Java Database Connectivity... JDBC In this section you will find the list all the best JDBC tutorials we
Advertisements
 

 

 

DMCA.com