Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in output

 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hello, I have created the following program in net beans(database connection). I set up odbc connection also. Data source name-student. But when i run the program, no output is displayed. can you please tell, why output is not displayed?
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check that the data got inserted in the database?
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhivya rajagopal wrote:
No, i didn't check. I am using sql server 2005. should i create the table already?Should i set odbc connection every time before running the program?

There should be a table created before you insert some data into it. Creating a table is a one time and it can be done manually by running the SQL queries.
 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thank you mohamed. I created one table . and run the program, I get the following error:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)
 
Mohamed Sanaulla
Saloon Keeper
Pie
Posts: 3159
33
Google App Engine Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dhivya rajagopal wrote:

JDBC CONNECTION
**** **********
SQL EXCEPTION:[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''. The user is not associated with a trusted SQL Server connection.
BUILD SUCCESSFUL (total time: 2 seconds)

So the error message says what you are missing- user, password
 
Raghavan Muthu
Ranch Hand
Posts: 3381
Mac MySQL Database Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can spend sometime in reading this tutorial on JDBC
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic