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



Home Answers Viewqa Java-Beginners 13994-Problems-connecting-to-a-database.-Java Problems connecting to a database. Java/SQLite
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


pepe
Problems connecting to a database. Java/SQLite
1 Answer(s)      4 years and a month ago
Posted in : Java Beginners


`print("try { con = DriverManager.getConnection("jdbc:sqlite:db/Freepark.sqlite"); } catch (SQLException e) { // TODO Auto-generated catch block System.out.println("error al buscar la base de datos"); }");`

I am trying to do my first querys on an SQL database but i am having problems connecting to it, I think the problem is the URL for sure, the proyect name is BaseTest and inside proyect folder I have a subfolder called db and inside it it's Freepark.sqlite.When I run the proyect the println message appears so I know that the problem is the url. Things like class.forName and so are already done above this code sample.


Advertisement
View Answers

April 21, 2012 at 3:49 PM


you just create the object in your java java file like DataBase db = new DataBase();

and you can use database like db. delete All();



Related Tutorials/Questions & Answers:
Problems connecting to a database. Java/SQLite
Problems connecting to a database. Java/SQLite  `print("try { con = DriverManager.getConnection("jdbc:sqlite:db/Freepark.sqlite"); } catch... on an SQL database but i am having problems connecting to it, I think the problem
connecting to database - Struts
connecting to database  Hi I am having problems with connection to MS SQL Server 2005 database. My first is what do i write in struts... information via the database in my web page. Thanks Tayo  Hi friend
Advertisements
Connecting to a database through the Proxy.
Connecting to a database through the Proxy.  Connecting to a database through the Proxy I want to connect to remote database using a program that is running in the local network behind the proxy. Is that possible
Connecting code of reset password to database
Connecting code of reset password to database  connecting code of reset password to database
Connecting to MYSQL Database in Java
Connecting to MYSQL Database in Java  I've tried executing the code... to the database"); conn.close(); System.out.println("Disconnected from database"); } catch (Exception e) { System.out.println("Error
connecting with database - Struts
connecting with database  I am creating an application where when jsp page is displayed, it contains the combo box where data is populated from the database.it has 3 buttons and the functionality for all buttons is different
Connecting JTable to database - JDBC
Connecting JTable to database  Hi.. I am doing a project on Project Management System for which i created the user interfaces.. I have a user... to store this JTable content in my database table.. This is a very important
connecting to access database
connecting to access database  print("code sample");Hi I Write java... this there is no error but my data is not going to my Acess Database. There is working... Access Driver(*.mdb) Select database name and Create the DSN name (e.g access
Connecting Oracle database with struts - Struts
Connecting Oracle database with struts  Can anyone please provide me some solutions on Connection between Oracle database and struts
connecting to a database dynamically - JSP-Servlet
connecting to a database dynamically   abc.html :- abc.jsp :- Above code gives the following... with database dynamically. Plz debug the code and explain the reasons for the exception
code for connecting reset password code to database.
code for connecting reset password code to database.  code for connecting reset password code to database.   Hello Friend, Do you want to change your password and update the password to database
Connecting to Database from a hyperlink in JSP - JSP-Servlet
Connecting to Database from a hyperlink in JSP  How can I connect to database by clicking on a hyperlink in a JSP Page.Can you please give me sample... which is connect to database using jdbc database
jsp -sevlet connecting to database using dropdown
jsp -sevlet connecting to database using dropdown  How can I get my dropdown list from oracle database and then submit it to another table in JSP. I... to the database and fetches an array of strings from a database table and then sends
Connecting to the Database Using JDBC and Pure Java driver
Connecting to the Database JDBC Driver In our search engine we are using MySQL database server and MM.MySQL Driver for connecting our application to the database. MM.MySQL Driver
Connecting to MySQL database and retrieving and displaying data in JSP page
Connecting to MySQL database and retrieving and displaying data in JSP page...;org.gjt.mm.mysql.Driver").newInstance(); Connecting to your database To connect...; This tutorial shows you how to connect to MySQL database and retrieve the data
Connecting to a MySQL Database in Java
Connecting to a MySQL Database in Java   ... the data in the database with the help of java,  instead of going to database... will learn how to connect the MySQL database with the Java file. Firstly, we need
Error in connecting to the mySQL database in TOMCAT using more than one PC (database connection pooling)
Error in connecting to the mySQL database in TOMCAT using more than one PC (database connection pooling)  how do i implement connection pooling... String strDataSource = "java:comp/env/jdbc/HTHLogDB"; ic = new InitialContext
arraylist problems?
arraylist problems?   myprogram needs to ask the user for a file name. The file will contain a name on each line. Put each of the names into an ArrayList. After you have put all of the names into the ArrayList search through
connecting databases
connecting databases  I need to connect mysql on 2 or more remote pc'c. how can i giv the ip address for 2 or more systems. is it possible to connect to the required systems by user specifying the database and table name my
Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public
Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public
Problems in Stringtokenizer
Problems in Stringtokenizer  hi here is my code import java.util.*; import java.io.*; import java.util.Scanner; class Node { public boolean marked; public int node_no; public String node_type; //public float value; //public
Null pointer exceptation-Java Servlet web application,Problem connecting with MYSQL database
Null pointer exceptation-Java Servlet web application,Problem connecting.... T_T I have develop my java web application in window Environment and now i... system won't be able to connect to database in pooling environment. i try follow some
Problems With Struts - Development process
Problems With Struts   Respected Sir , While Deploying Struts Application in Tomcat 5.0 ,using Forward Action.This can... resolve this problems. Thanks & Regards Akhtar
problems regrading .properties files
problems regrading .properties files  According to my struts application my i ve to register particular data into the DB..It will succefully registerd according to my validation condition which m placed in the validate mathod
connecting to timesten in web application
connecting to timesten in web application  Please give me the steps connecting to timesten in web application. Am using jsp
Java: Some problems in given condition
Java: Some problems in given condition   SIR, I want to get the values from the table( database), if any one of the column of the table value is 0. Then one alert should b printed in application using Java. If(att.getdata1()==0
java connecting frames
java connecting frames  how to connect one frame to another frame by using awt or swings?`print("code sample
Connecting jboss with sql 2005 - Struts
Connecting jboss with sql 2005  Hai, i have project that was developed in struts,backed is sqlserver 2005 and and i am using jboss. I want to connect another database (sqlserver 2005) with my project.could u please help me
 

 

 

DMCA.com