Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within JDBC and Relational Databases
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
JDBC and Relational Databases
Iam connecting a java program to Open Office Base, what should my user name and password be ?
Vijay Tyagi
Ranch Hand
Posts: 52
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I have created database and a table in it in OO base,I was not asked for any user name or pwd
I have hsqldb.jar
If I leave username and pwd blank here
con = DriverManager.getConnection("jdbc:hsqldb:file:"+db_file_name_prefix,"","");
I get an exception "user not found"
I am a
jdbc
newb . Also I am not sure if this line is right
con = DriverManager.getConnection("jdbc:hsqldb:file:"+db_file_name_prefix,"","");
Vijay Tyagi
Ranch Hand
Posts: 52
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I changed user name to "sa",now it works,
But I get an exception "Invalid schema"
what could be the reason?
Vijay Tyagi
Ranch Hand
Posts: 52
posted 11 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
"abc" is my DB and Table1 is my table name.I have filled the rows with values
import java.sql.*; public class ViewingBase { public static void main(String[] args) { Connection con=null; Statement stmt; ResultSet rs; try{ String db_file_name_prefix = "C:\\abc"; Class.forName("org.hsqldb.jdbcDriver"); con = DriverManager.getConnection("jdbc:hsqldb:file:"+db_file_name_prefix,"sa",""); stmt = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY); rs = stmt.executeQuery("SELECT * FROM abc.Table1;"); while(rs.next()){ System.out.println(rs.getString("ID") + " " + rs.getString("Name") + " " + rs.getString("Color")); } }catch(Exception e){ System.err.println(e); } } }
Thanks
Please help
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
error in data base connection
What is wrong here
Variable is not getting transferred from controller servlet to model
Driver for Derby database
How to update a database using web forms
More...