Results 1 to 2 of 2
Thread: Help with Java and MS access
- 04-29-2008, 06:48 PM #1
Member
- Join Date
- Apr 2008
- Posts
- 1
- Rep Power
- 0
Help with Java and MS access
I have the next problem. I want to make a little translation program, I have in access a table that has two columns Español and Frances.
I'm using a JtextBox to introduce a spanish word, for example ROJO, and I want to retrieve the french word rouge.
The query sentence shows me the last word in Frances. I have the following structure:
Español Frances
rojo rouge
negro noir
and this is the code
try
{
String ruta = "C:\\dicc.mdb";
String referencia = "jdbc:odbc:MS Access Database;DBQ="+ruta;
//Levantar controlador o carga el controlador
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection conecta = DriverManager.getConnection(referencia);
Statement s = conecta.createStatement();
ResultSet rs = s.executeQuery("SELECT Español, Frances FROM espfran =");
while(rs.next())
{
res=rs.getString("Frances");
}
jLabel.setText(res);
conecta.close();
}
catch(Exception jl)
{
JOptionPane.showMessageDialog(null,jl.getMessage() );
}
Hope someone can help me. please email me @ lemurianredmage@hotmail.com
- 04-30-2008, 01:46 PM #2
Similar Threads
-
Java Native Access (JNA) return types of void *
By burnumd in forum Advanced JavaReplies: 5Last Post: 01-15-2010, 12:09 AM -
Trying to get my Java Bean to access a parm that I'm passing via a jsp?
By 72dolfan in forum JavaServer Faces (JSF)Replies: 1Last Post: 03-13-2008, 02:36 PM -
Help with access a database using Microsoft Access
By cachi in forum JDBCReplies: 1Last Post: 08-07-2007, 07:51 AM -
Access Email usind a java mail client Access Email usind a java mail client
By consult4u in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 07-31-2007, 08:29 AM -
How to access system calls in java
By Albert in forum New To JavaReplies: 1Last Post: 07-13-2007, 03:12 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks