473,385 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

open office database in java

how can i connect an open office database in java?
Jun 13 '07 #1
7 2648
r035198x
13,262 8TB
how can i connect an open office database in java?
What do you mean by an office database? Java uses ldbc to connect to databases. You may want to read sun's jdbc tutorial.
Jun 13 '07 #2
i'm using ubuntu.. with open office database..

import java.sql.*;


public class DB {

/**
* @param args
*/
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub

Class.forName("org.hsqldb.jdbcDriver");

Connection mycon=DriverManager.getConnection("jdbc:hsqldb:fil e://home//workspace//Database//db","sa","");
Statement Que=mycon.createStatement();
ResultSet result=Que.executeQuery("SELECT * FROM Table1");

}


im having an exception
Exception in thread "main" java.lang.ClassNotFoundException: org.hsqldb.jdbcDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:319)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:164)
at DB.main(DB.java:12)

maybe i did not include the hsqldb.jar
how can i include the file? im using eclipse
Jun 13 '07 #3
JosAH
11,448 Expert 8TB
maybe i did not include the hsqldb.jar
how can i include the file? im using eclipse
I'm sure you didn't include it; navigate to:

Project>Properties>Java Build Path>Libraries>Add External Jars ...

and add the hsqldb.jar file.

kind regards,

Jos
Jun 13 '07 #4
its works.. thanks..

but i'm having Table not found in statement [SELECT ID FROM Assets]

i think i can figure this out..

thanks again..
Jun 13 '07 #5
Is openOffice.org database has a different method in displaying filtered contents?

im having Table not found in java.. and in openoffice itself..

but in queries tab, it will work.. how can i do that in java?
Jun 13 '07 #6
r035198x
13,262 8TB
Is openOffice.org database has a different method in displaying filtered contents?

im having Table not found in java.. and in openoffice itself..

but in queries tab, it will work.. how can i do that in java?
Perhaps you are passing an incorrect table name (case issues e.t.c).
Jun 13 '07 #7
O just misinterpret the jdbc...

it will create it's own database file if the file is not present..

So you need to create tables etc..

that was great.. thanks guys..
Jun 13 '07 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

115
by: TheAd | last post by:
At this moment I use MsAccess and i can build about every databound application i want. Who knows about a serious open source alternative? Because Windows will be a client platform for some time, i...
0
by: dedmike | last post by:
Yesterday, Slashdot profiled the new Open Office 2.0 BETA with what was referred to as an "Access-like application." That "Access-like application" is HSQLDB (misidentified as hSQL). Slashdot...
9
by: Tom Weston | last post by:
Help I have 4 databases containing different data relating to safety, not written by me. It is not possible to merge the databases into one large data base. I would like to create a user interface...
5
by: Java script Dude | last post by:
For those who are missing the feature on how to import into Open Office dBase app from text files and spreadsheets in OOO Base 2.0: A wizard exists to import from spreadsheets only at this time...
27
by: Mike | last post by:
Open source programs in general suck pretty bad also. Here are some loose facts regarding why projects like Linux, PHP, MYSQL, and other open source programs suck: - Linux is simply a clone of...
3
by: toffee | last post by:
Hi all, I got a pre-formatted spreadsheet. would it be possible using js to copy the data from a table on the current webpage, open the spreadsheet and paste the content ? if so, anyone got any...
22
by: anubhav vij | last post by:
how to open an ms office application either .doc,.xls,etc in java?? i m new at java so don't know how to open a .doc or .txt file using java .
8
by: evenlater | last post by:
I have an .accde file with custom ribbons and with "Allow Full Menus" set to False, but the Office Button menu still gives the user the ability to create a new Access database, or -- much worse --...
12
by: godiva | last post by:
Hi, Last week one client had errors caused by another program which led the IT guys to wipe out and rebuild the hard drive on one particular computer. Prior to this happening, the people in this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.