Babugouda patil

Ranch Hand
+ Follow
since Mar 13, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Babugouda patil


Ok Jeff,

Thank you very much for your reply.
Hi All,

I used the below code it's working fine and getting expected result.


I want to know can I handle this program better than this? because I am feeling using join() method is not appropriate, what if I have 1000 of threads?
One more question is it possible to suspend main thread till all other threads excecute?

Hi Jeff and Tony thanks for your reply.

@Jeff
I have tried to use join before this post I didn't det desired result. I want to print the count value after all threads I created so output should come 3.

How can I join main thread? Please reply

Please help me with synchronization how to handle it.

Hi Guys,

I want to write program on thread but I am not getting how to handle it. Below is the my requirement and code.




I want to excecute get.getCount() after all threads excecuted and I should get count 3. Please help me in modification.
Hi,

I am new to Hibernate. I am not able to make connection. Below I placed all code which I have used to make connection to SQL Server 2008 but it's giving below error. Please check my configuration file as well and correct me.

Console Error:
Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:99)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)
at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)
at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:160)
at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:81)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1473)
at org.babu.hibenate.HibernateTest.main(HibernateTest.java:20)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:130)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1195)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(SQLServerConnection.java:1054)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:758)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)
... 5 more


Below is code:

hibernate.cfg.xml file configuration:

<hibernate-configuration>

<session-factory>

<!-- Database connection settings -->
<property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
<property name="connection.url">jdbc:sqlserver://localhost:1433;databaseName=JDBC;</property>
<property name="connection.username">BABU-GOUDA/hp</property>
<property name="connection.password"></property>

<!-- JDBC connection pool (use the built-in) -->
<property name="connection.pool_size">1</property>

<!-- SQL dialect -->
<property name="dialect">org.hibernate.dialect.SQLServerDialect</property>

<!-- Disable the second-level cache -->
<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>

<!-- Echo all executed SQL to stdout -->
<property name="show_sql">true</property>

<!-- Drop and re-create the database schema on startup -->
<property name="hbm2ddl.auto">create</property>

<!-- Names the annotated entity class -->
<mapping class="org.babu.dto.UserDetails"/>

</session-factory>

</hibernate-configuration>

and HibernateTest.java class is:



Please check and tell me where went wrong and what's the problem.

Hi Pradeep,

It took me around 4 months of preparation. Actually I am working in software company along with 8 hours of work daily I did it(present am not working on java I want to move to java development so I did it). So now you can estimate your time dude. If you want to succeed you need to write lot of small programs for your understanding purpose. Take certification exam as a point of learning not just for certificate.

All the best
14 years ago

Hi All,

Yesterday I took exam cleared with 91% After finishing exam I am feeling very relax. It took me around 4 months of preparation, I started preparation with KB book and read the book almost 2 times and referred javachamp , certpal and Examlabs. The below is the my score in all.

javachamp: 63% avg in all section wise topics.
certpal 3rd 73%(first 2 I took during preparation stage so not considered).
examlabs in all 3 45% average.

I am very thankful to all forum leaders of this wonderful site, author of KB book, Devaka, javachamp and CertPal

Now i have few questions.
1) When I will get certificate
2) How can I download SCJP logo
3) Which step I should take towards my next preparation.


Please help me


14 years ago
Hi,

Please anyone explain me this code diagrammatically? According to examlab answer 2 object will be garbage collected please explain me
Hi,

Can we directly go exam center and write the exam before taking voucher?Is there any possibility for writing exam like that? I heard just before exam itself we can take voucher and we can write the exam. If we need to take voucher before exam means how many days before we need to take and schedule the exam?

Please help me.
Hi Teja,

Congrats very good score. Please can you elaborate your test preparation?
14 years ago